/* ═══════════════════════════════════════════════════════════
   NOTA — Notes App Styles
   Design: Editorial Dark with warm amber accents
   Fonts: DM Serif Display + DM Sans + JetBrains Mono
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  /* Dark theme (default) */
  --bg:        #0f0e0d;
  --bg-2:      #161512;
  --bg-3:      #1e1c19;
  --bg-4:      #252320;
  --border:    #2a2724;
  --border-2:  #33302c;
  --text:      #e8e4dc;
  --text-2:    #a09890;
  --text-3:    #6a6058;
  --accent:    #d4a84b;
  --accent-2:  #b8902d;
  --accent-dim:#d4a84b22;
  --danger:    #c0392b;
  --danger-dim:#c0392b22;
  --pin:       #e8b84b;
  --locked:    #7ec8a4;

  /* Tag colors */
  --tag-work:     #5b8cff;
  --tag-study:    #7ec8a4;
  --tag-ideas:    #d4a84b;
  --tag-personal: #c47bbd;

  /* Spacing / radius */
  --radius:  10px;
  --radius-lg: 16px;
  --sidebar-w: 240px;

  /* Transitions */
  --t: 0.18s ease;
  --t-slow: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg:        #f8f5f0;
  --bg-2:      #f2ede5;
  --bg-3:      #ebe4d8;
  --bg-4:      #e0d7c8;
  --border:    #d8cfbe;
  --border-2:  #c8bfae;
  --text:      #1a1714;
  --text-2:    #5a5048;
  --text-3:    #9a9088;
  --accent:    #c4932a;
  --accent-2:  #a87820;
  --accent-dim:#c4932a18;
  --danger:    #c0392b;
  --danger-dim:#c0392b15;
}

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

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

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--t), color var(--t);
  overflow-x: hidden;
}

input, textarea, button { font-family: inherit; }

button { cursor: pointer; border: none; background: none; }

.hidden { display: none !important; }

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

/* ══════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

/* Logo */
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-mark {
  width: 30px; height: 30px;
  background: var(--accent);
  color: #0f0e0d;
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-weight: 400;
}
.logo-text {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* Topbar sections */
.topbar-left { flex-shrink: 0; }
.topbar-center { flex: 1; max-width: 480px; margin: 0 auto; }
.topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Search */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap input {
  width: 100%;
  height: 36px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 72px 0 36px;
  color: var(--text);
  font-size: 13.5px;
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}
.search-wrap input::placeholder { color: var(--text-3); }
.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-icon {
  position: absolute;
  left: 11px;
  width: 15px; height: 15px;
  stroke: var(--text-3);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.search-kbd {
  position: absolute;
  right: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
}

/* Ghost buttons */
.btn-ghost {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--t), color var(--t);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }
.btn-ghost svg {
  width: 15px; height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.btn-ghost.small { height: 30px; padding: 0 9px; font-size: 12px; }

/* Round icon button */
.btn-icon-round {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background var(--t), color var(--t);
}
.btn-icon-round:hover { background: var(--bg-3); color: var(--text); }
.btn-icon-round svg {
  width: 15px; height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Show/hide sun/moon based on theme */
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* Filter dropdown */
.filter-wrap { position: relative; }
.filter-count {
  background: var(--accent);
  color: #0f0e0d;
  font-size: 10px;
  font-weight: 600;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 8px 0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  z-index: 200;
  animation: dropIn 0.18s ease;
}
.dropdown.open { display: block; }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 14px 4px;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.dropdown-item:hover { background: var(--bg-4); color: var(--text); }
.dropdown-item input[type="radio"] { accent-color: var(--accent); }
.dropdown-item.active { color: var(--accent); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }
.tag-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tag-dot[data-tag="Work"]     { background: var(--tag-work); }
.tag-dot[data-tag="Study"]    { background: var(--tag-study); }
.tag-dot[data-tag="Ideas"]    { background: var(--tag-ideas); }
.tag-dot[data-tag="Personal"] { background: var(--tag-personal); }

/* ══════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  height: calc(100vh - 58px);
  overflow: hidden;
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-2);
}
.sidebar-inner { padding: 20px 16px; display: flex; flex-direction: column; gap: 28px; }

.sidebar-heading {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-value {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 11px;
  color: var(--text-3);
}

/* Tags sidebar */
.tag-list { display: flex; flex-direction: column; gap: 4px; }
.tag-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
  text-align: left;
  transition: background var(--t), color var(--t);
  font-weight: 400;
}
.tag-pill:hover { background: var(--bg-3); color: var(--text); }
.tag-pill.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}
.tag-pill::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-3);
}
.tag-pill[data-tag="all"]::before       { background: var(--text-3); }
.tag-pill[data-tag="Work"]::before      { background: var(--tag-work); }
.tag-pill[data-tag="Study"]::before     { background: var(--tag-study); }
.tag-pill[data-tag="Ideas"]::before     { background: var(--tag-ideas); }
.tag-pill[data-tag="Personal"]::before  { background: var(--tag-personal); }

/* Insights */
.insight-list { display: flex; flex-direction: column; gap: 10px; }
.insight-item { display: flex; justify-content: space-between; align-items: center; }
.insight-label { font-size: 12px; color: var(--text-3); }
.insight-value { font-size: 12px; color: var(--text); font-weight: 500; }

/* ── NOTES AREA ─────────────────────────────────────────── */
.notes-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  flex-shrink: 0;
}
.notes-count { font-size: 12px; color: var(--text-3); }
.view-toggle { display: flex; gap: 4px; }
.view-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: background var(--t), color var(--t);
}
.view-btn:hover { background: var(--bg-3); color: var(--text); }
.view-btn.active { background: var(--accent-dim); color: var(--accent); }
.view-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Notes Grid */
.notes-grid {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  align-content: start;
}
.notes-grid.list-view {
  grid-template-columns: 1fr;
  gap: 8px;
}

/* ── NOTE CARD ──────────────────────────────────────────── */
.note-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: cardIn 0.25s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.note-card:hover {
  border-color: var(--border-2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.note-card.pinned { border-color: var(--pin); }
.note-card.pinned::before {
  content: '📌';
  position: absolute;
  top: 10px; right: 12px;
  font-size: 12px;
}
.note-card.locked {
  border-color: var(--locked);
}

/* Card accent strip (tag color) */
.note-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: transparent;
  transition: background var(--t);
}
.note-card[data-tag="Work"]::after     { background: var(--tag-work); }
.note-card[data-tag="Study"]::after    { background: var(--tag-study); }
.note-card[data-tag="Ideas"]::after    { background: var(--tag-ideas); }
.note-card[data-tag="Personal"]::after { background: var(--tag-personal); }

.card-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 5px;
  align-self: flex-start;
}
.card-tag[data-tag="Work"]     { background: #5b8cff22; color: var(--tag-work); }
.card-tag[data-tag="Study"]    { background: #7ec8a422; color: var(--tag-study); }
.card-tag[data-tag="Ideas"]    { background: var(--accent-dim); color: var(--tag-ideas); }
.card-tag[data-tag="Personal"] { background: #c47bbd22; color: var(--tag-personal); }

.card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}
.card-body {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  flex: 1;
}

/* Search highlight */
.card-body mark, .card-title mark {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 2px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.card-date {
  font-size: 11px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}
.card-lock-icon {
  font-size: 11px;
  color: var(--locked);
}

/* List view overrides */
.notes-grid.list-view .note-card {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.notes-grid.list-view .note-card::before { top: 14px; }
.notes-grid.list-view .card-body {
  -webkit-line-clamp: 1;
  flex: 1;
}
.notes-grid.list-view .card-title { font-size: 14px; min-width: 140px; max-width: 200px; }

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-3);
  padding: 40px;
  text-align: center;
}
.empty-icon {
  font-size: 40px;
  color: var(--accent);
  opacity: 0.4;
  font-family: 'DM Serif Display', serif;
}
.empty-title { font-family: 'DM Serif Display', serif; font-size: 20px; color: var(--text-2); }
.empty-sub { font-size: 13px; }

/* ══════════════════════════════════════════════════════════
   FAB
   ══════════════════════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px; height: 52px;
  background: var(--accent);
  color: #0f0e0d;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(212, 168, 75, 0.4);
  transition: transform var(--t), box-shadow var(--t);
  z-index: 50;
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 32px rgba(212, 168, 75, 0.55);
}
.fab:active { transform: scale(0.96); }
.fab svg {
  width: 22px; height: 22px;
  stroke: #0f0e0d;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* ══════════════════════════════════════════════════════════
   EDITOR PANEL
   ══════════════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.editor-panel {
  position: fixed;
  top: 0; right: 0;
  width: min(640px, 100vw);
  height: 100vh;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform var(--t-slow);
  box-shadow: -20px 0 60px rgba(0,0,0,0.4);
}
.editor-panel.hidden {
  display: flex;
  transform: translateX(100%);
  pointer-events: none;
}
/* Override display:none from .hidden for slide animation */
.editor-panel { display: flex !important; }
.editor-panel.hidden { pointer-events: none; }

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.editor-title {
  font-family: 'DM Serif Display', serif;
  font-size: 17px;
  color: var(--text);
  font-weight: 400;
}
.editor-actions { display: flex; align-items: center; gap: 4px; }

.btn-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: background var(--t), color var(--t);
}
.btn-close:hover { background: var(--danger-dim); color: var(--danger); }
.btn-close svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Title input */
.note-title-input {
  width: 100%;
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  font-weight: 400;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0 0 10px;
  color: var(--text);
  outline: none;
  transition: border-color var(--t);
}
.note-title-input::placeholder { color: var(--text-3); }
.note-title-input:focus { border-bottom-color: var(--accent); }

/* Tag selector */
.tag-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-btn {
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  transition: all var(--t);
}
.tag-btn:hover { border-color: var(--accent); color: var(--accent); }
.tag-btn.active[data-tag="Work"]     { background: #5b8cff22; border-color: var(--tag-work); color: var(--tag-work); }
.tag-btn.active[data-tag="Study"]    { background: #7ec8a422; border-color: var(--tag-study); color: var(--tag-study); }
.tag-btn.active[data-tag="Ideas"]    { background: var(--accent-dim); border-color: var(--tag-ideas); color: var(--tag-ideas); }
.tag-btn.active[data-tag="Personal"] { background: #c47bbd22; border-color: var(--tag-personal); color: var(--tag-personal); }

/* Markdown toolbar */
.markdown-toolbar {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.md-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
}
.md-btn:hover { background: var(--bg-4); color: var(--text); }

/* Content area */
.editor-content-wrap { flex: 1; display: flex; flex-direction: column; min-height: 200px; }

.note-content-input {
  width: 100%;
  flex: 1;
  min-height: 200px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  font-family: 'DM Sans', sans-serif;
}
.note-content-input::placeholder { color: var(--text-3); }
.note-content-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Markdown Preview */
.note-preview {
  flex: 1;
  min-height: 200px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.7;
  overflow-y: auto;
}
.note-preview h1 { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--text); margin-bottom: 8px; font-weight: 400; }
.note-preview h2 { font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--text); margin-bottom: 6px; font-weight: 400; }
.note-preview h3 { font-size: 15px; color: var(--text); margin-bottom: 6px; font-weight: 600; }
.note-preview strong { color: var(--text); font-weight: 600; }
.note-preview em { color: var(--text-2); font-style: italic; }
.note-preview code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--bg-4);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--accent);
}
.note-preview ul, .note-preview ol { padding-left: 20px; }
.note-preview li { margin-bottom: 4px; }
.note-preview p { margin-bottom: 8px; }

/* Editor footer */
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  flex-shrink: 0;
}
.editor-meta { font-size: 11px; color: var(--text-3); font-family: 'JetBrains Mono', monospace; }
.editor-footer-actions { display: flex; gap: 8px; }

/* Buttons */
.btn-primary {
  padding: 0 18px;
  height: 36px;
  background: var(--accent);
  color: #0f0e0d;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--t), transform var(--t);
}
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:active { transform: scale(0.97); }

.btn-danger {
  padding: 0 14px;
  height: 36px;
  background: var(--danger-dim);
  color: var(--danger);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--t), border-color var(--t);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ══════════════════════════════════════════════════════════
   CONFIRM DIALOG
   ══════════════════════════════════════════════════════════ */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}
.dialog {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  animation: dialogIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
.dialog-icon { font-size: 28px; margin-bottom: 12px; }
.dialog-title { font-family: 'DM Serif Display', serif; font-size: 20px; margin-bottom: 8px; font-weight: 400; }
.dialog-msg { font-size: 13px; color: var(--text-2); margin-bottom: 22px; }
.dialog-actions { display: flex; gap: 10px; justify-content: center; }

/* ══════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════ */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
  pointer-events: none;
}
.toast {
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--text);
  animation: toastIn 0.25s ease;
  pointer-events: auto;
  white-space: nowrap;
}
.toast.success { border-color: var(--accent); color: var(--accent); }
.toast.error   { border-color: var(--danger); color: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar-center { max-width: 100%; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .logo-text { display: none; }
  .btn-ghost span { display: none; }
  .notes-grid { padding: 4px 12px 80px; grid-template-columns: 1fr; }
  .editor-panel { width: 100vw; }
  .fab { bottom: 18px; right: 18px; }
}

@media (min-width: 1200px) {
  .notes-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (min-width: 1600px) {
  .notes-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
