/* styles-sidebar.css — extracted from styles.css (Sidebar, smart folders, bookmarks styles) */

/* ── Sidebar & Smart Folders (app.js) ────────────────────────── */

      .sidebar-empty {
        text-align: center;
        padding: 20px;
        opacity: 0.4;
        font-size: var(--fs-base);
      }
      .sidebar-date {
        font-size: var(--fs-xs);
        color: var(--text-muted);
        white-space: nowrap;
        flex-shrink: 0;
      }
      .sidebar-restore-btn {
        font-size: var(--fs-sm);
        padding: 2px 7px;
        background: rgba(var(--primary-rgb), 0.15);
        border: 1px solid rgba(var(--primary-rgb), 0.3);
        border-radius: var(--radius-sm);
        color: var(--primary-light);
        cursor: pointer;
        white-space: nowrap;
        flex-shrink: 0;
      }
      .sidebar-restore-btn:hover { background: rgba(var(--primary-rgb), 0.25); }
      .section-label {
        font-size: var(--fs-sm);
        color: var(--text-dim);
        letter-spacing: 0.1em;
        padding: 8px 12px 4px;
        text-transform: uppercase;
        user-select: none;
      }
      .folder-item {
        padding: 7px 12px;
        border-radius: var(--radius-md);
        cursor: pointer;
        font-size: var(--fs-base);
        color: var(--text-dim);
        display: flex;
        align-items: center;
        gap: 6px;
        transition: 0.2s;
        margin-bottom: 2px;
        user-select: none;
      }
      .folder-item:hover {
        background: rgba(var(--primary-rgb), 0.1);
        color: var(--text-main);
      }
      .folder-item.drop-target {
        background: rgba(var(--primary-rgb), 0.2);
        border: 1px dashed var(--primary);
      }
      .folder-toggle {
        font-size: var(--fs-sm);
        width: 12px;
        display: inline-block;
        transition: transform 0.2s;
      }
      .folder-name {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .folder-count {
        font-size: var(--fs-sm);
        color: var(--text-muted);
        min-width: 14px;
        text-align: right;
      }
      .folder-delete {
        opacity: 0;
        background: none;
        border: none;
        color: var(--color-danger);
        cursor: pointer;
        font-size: var(--fs-sm);
        padding: 2px 4px;
        border-radius: var(--radius-xs);
        transition: 0.2s;
      }
      .folder-item:hover .folder-delete {
        opacity: 0.7;
      }
      .folder-delete:hover {
        opacity: 1 !important;
        background: rgba(var(--color-danger-rgb), 0.15);
      }
      .folder-note {
        padding-left: 24px;
      }
      .pin-btn {
        opacity: 0;
        background: none;
        border: none;
        color: var(--text-dim);
        cursor: pointer;
        font-size: var(--fs-sm);
        padding: 2px 4px;
        border-radius: var(--radius-xs);
        transition: 0.2s;
      }
      .tree-item:hover .pin-btn {
        opacity: 0.6;
      }
      .pin-btn.pinned {
        opacity: 1 !important;
        color: var(--accent);
      }
      .tree-item.is-pinned {
        border-left: 2px solid var(--accent);
        padding-left: 10px;
      }
      .search-highlight-mark {
        background: rgba(251, 191, 36, 0.35);
        color: var(--text-main);
        border-radius: var(--radius-xs);
        padding: 0 1px;
        outline: 1px solid rgba(251, 191, 36, 0.4);
      }
      .sidebar-bottom-btn {
        flex: 1;
        padding: 6px;
        border-radius: var(--radius-base);
        border: 1px solid var(--glass-border);
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        font-size: var(--fs-sm);
        transition: all 0.2s;
      }
      .sidebar-trash-btn:hover {
        background: rgba(var(--color-danger-rgb), 0.15);
        color: var(--color-danger);
      }
      .sidebar-archive-btn:hover {
        background: rgba(var(--primary-rgb), 0.15);
        color: var(--accent);
      }
      .tag-suggestion-item {
        padding: 6px 10px;
        cursor: pointer;
        font-size: var(--fs-base);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        transition: background 0.15s;
      }
      .tag-suggestion-item:hover,
      .tag-suggestion-item.tag-suggestion-active {
        background: rgba(var(--primary-rgb), 0.2);
      }
      .tag-suggestion-item b {
        color: var(--primary-light);
      }
      .backlink-item {
        cursor: pointer;
        padding: 4px 0;
        color: var(--text-dim);
        display: flex;
        align-items: center;
        gap: 6px;
        transition: color 0.15s;
      }
      .backlink-item:hover {
        color: var(--primary-light);
      }
      .dash-backlink-item {
        padding: 6px 8px;
        margin-bottom: 4px;
        background: rgba(255,255,255,0.03);
        border-radius: var(--radius-base);
        cursor: pointer;
        transition: background 0.15s;
      }
      .dash-backlink-item:hover {
        background: rgba(var(--primary-rgb),0.1);
      }
      .note-color-indicator {
        width: 4px;
        border-radius: var(--radius-xs);
        align-self: stretch;
        flex-shrink: 0;
        margin-right: 4px;
      }
      .note-color-picker {
        display: flex;
        gap: 5px;
        padding: 8px 10px;
        background: var(--card-bg-solid);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: var(--radius-md);
        box-shadow: 0 8px 24px rgba(0,0,0,0.5);
      }
      .note-color-dot {
        width: 22px;
        height: 22px;
        border-radius: var(--radius-full);
        border: 2px solid transparent;
        cursor: pointer;
        transition: 0.15s;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: var(--fs-xs);
        color: rgba(255,255,255,0.5);
        padding: 0;
      }
      .note-color-dot:hover {
        transform: scale(1.2);
        border-color: var(--text-muted);
      }
      .note-color-dot.active {
        border-color: var(--text-main);
        box-shadow: 0 0 8px rgba(var(--primary-rgb),0.5);
      }
      body.light-mode .note-color-picker {
        background: var(--bg) !important;
        border-color: rgba(0,0,0,0.1) !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
      }
      body.light-mode .note-color-dot {
        color: rgba(0,0,0,0.3) !important;
      }
      body.light-mode .note-color-dot.active {
        border-color: var(--text-main) !important;
      }
.search-row {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 0.75rem;
}
.search-row .search-input {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}
.sort-picker-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-base);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  cursor: pointer;
  font-size: var(--fs-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  flex-shrink: 0;
}
.sort-picker-btn:hover {
  background: rgba(var(--primary-rgb),0.15);
  color: var(--primary-light);
  border-color: rgba(var(--primary-rgb),0.4);
}
.sort-picker-btn.active {
  background: rgba(var(--primary-rgb),0.2);
  color: var(--primary-light);
  border-color: rgba(var(--primary-rgb),0.5);
}
.sort-picker-dropdown {
  position: absolute;
  top: 100%;
  right: auto;
  z-index: var(--z-dropdown);
  background: var(--card-bg-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 4px;
  min-width: 200px;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: gn-popup-in 0.15s ease;
}
.sort-picker-dropdown .sort-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-base);
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text-dim);
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sort-picker-dropdown .sort-option:hover {
  background: rgba(var(--primary-rgb),0.15);
  color: var(--primary-light);
}
.sort-picker-dropdown .sort-option.active {
  background: rgba(var(--primary-rgb),0.2);
  color: var(--primary-light);
  font-weight: 600;
}
.sort-picker-dropdown .sort-option .sort-check {
  width: 16px;
  text-align: center;
  font-size: var(--fs-sm);
}
body.light-mode .sort-picker-dropdown {
  background: var(--card-bg-solid);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
body.light-mode .sort-picker-dropdown .sort-option:hover {
  background: rgba(var(--primary-rgb),0.08);
}
.sidebar-left {
  transition: width 0.2s ease, padding 0.2s ease, min-width 0.2s ease, opacity 0.2s ease;
}
.sidebar-left.sidebar-collapsed {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0;
}
.sidebar-collapse-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-base);
  border: none;
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  transition: 0.2s;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  background: rgba(var(--primary-rgb),0.2);
  color: var(--primary-light);
}
.sidebar-expand-btn {
  position: fixed;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-dropdown);
  width: 20px;
  height: 48px;
  border-radius: 0 8px 8px 0;
  border: 1px solid var(--glass-border);
  border-left: none;
  background: var(--card-bg-solid);
  color: var(--text-dim);
  cursor: pointer;
  font-size: var(--fs-sm);
  display: none;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  backdrop-filter: blur(10px);
}
.sidebar-expand-btn:hover {
  background: rgba(var(--primary-rgb),0.3);
  color: var(--primary-light);
  width: 24px;
}
.sidebar-expand-btn.visible {
  display: flex;
}
body.light-mode .sidebar-expand-btn {
  background: var(--card-bg-solid);
  border-color: rgba(0,0,0,0.1);
}
.recent-section-label {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  letter-spacing: 0.08em;
  padding: 6px 12px 2px;
  text-transform: uppercase;
  user-select: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}
.recent-section-label:hover {
  color: var(--primary-light);
}
.recent-section-label .toggle-arrow {
  font-size: var(--fs-xs);
  transition: transform 0.15s;
}
.recent-note-item {
  padding: 4px 12px 4px 16px;
  border-radius: var(--radius-base);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}
.recent-note-item:hover {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--text-main);
  opacity: 1;
}
.recent-note-item .recent-note-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.recent-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, rgba(var(--primary-rgb),0.5) 50%, transparent 95%);
  margin: 8px 12px;
}

/* ── Bookmarks / Favorites quick-access strip ── */
.bookmarks-strip {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE 10+ */
  flex-shrink: 0;
}
.bookmarks-strip::-webkit-scrollbar { display: none; }
.bookmark-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-base);
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  max-width: 140px;
  line-height: 1.3;
}
.bookmark-chip:hover {
  background: rgba(var(--primary-rgb), 0.18);
  color: var(--text-main);
  border-color: rgba(var(--primary-rgb), 0.35);
}
.bookmark-chip.active {
  background: rgba(var(--primary-rgb), 0.22);
  color: var(--primary-light);
  border-color: rgba(var(--primary-rgb), 0.4);
}
.bookmark-chip__icon {
  font-size: var(--fs-sm);
  flex-shrink: 0;
}
.bookmark-chip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-drop-indicator {
  height: 2px;
  background: var(--primary);
  margin: 0 8px;
  border-radius: var(--radius-xs);
  transition: opacity 0.15s;
  pointer-events: none;
}
.tag-chip.untagged-chip {
  border-style: dashed;
  font-style: italic;
  opacity: 0.8;
}
.tag-chip.untagged-chip:hover {
  opacity: 1;
}
.tag-chip.untagged-chip.active-filter {
  border-style: solid;
  font-style: normal;
  opacity: 1;
}
.search-input-tokens-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  min-height: 34px;
  box-sizing: border-box;
  cursor: text;
  transition: border-color 0.2s;
}
.search-input-tokens-wrap:focus-within {
  border-color: var(--primary);
}
.search-input-tokens-wrap .search-input {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  min-width: 60px;
  flex: 1;
  width: auto;
  height: auto;
  font-size: var(--fs-base);
}
.search-input-tokens-wrap .search-input:focus {
  border-color: transparent;
  outline: none;
}
.search-token-chips {
  display: contents;
}
.search-token-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(var(--primary-rgb), 0.18);
  color: var(--primary-light);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: var(--radius-sm);
  padding: 1px 5px 1px 6px;
  font-size: var(--fs-sm);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.6;
}
.search-token-chip .chip-remove {
  cursor: pointer;
  opacity: 0.55;
  font-size: 0.8em; /* stylelint-disable-line declaration-property-value-disallowed-list */
  line-height: 1;
  padding: 0 1px;
  border-radius: var(--radius-xs);
  transition: opacity 0.15s;
}
.search-token-chip .chip-remove:hover { opacity: 1; }
.tag-picker-btn.has-filter {
  background: rgba(var(--primary-rgb), 0.2);
  color: var(--primary-light);
  border-color: rgba(var(--primary-rgb), 0.5);
}
.tag-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  width: 240px;
  background: var(--card-bg);
  border: 1px solid rgba(var(--primary-rgb),0.3);
  border-radius: var(--radius-md);
  padding: 4px;
  max-height: 300px;
  overflow-y: auto;
  z-index: var(--z-sticky);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
}
.tag-dropdown-panel.open { display: block; }
.tag-dropdown-panel::-webkit-scrollbar { width: 6px; }
.tag-dropdown-panel::-webkit-scrollbar-track { background: transparent; }
.tag-dropdown-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: var(--radius-xs); }
.tag-dropdown-panel::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.tag-dd-empty {
  padding: 8px 10px;
  color: var(--text-dim);
  font-size: var(--fs-base);
  font-style: italic;
  text-align: center;
}
.tag-dd-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text-main);
  transition: background 0.15s;
}
.tag-dd-item:hover { background: rgba(var(--primary-rgb),0.12); }
.tag-dd-cb {
  accent-color: var(--primary);
  margin: 0;
  pointer-events: none;
  flex-shrink: 0;
}
.tag-dd-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-dd-untagged { flex: 1; font-style: italic; opacity: 0.7; }
.tag-dd-action {
  background: none; border: none; cursor: pointer;
  font-size: var(--fs-sm); padding: 2px 3px; border-radius: var(--radius-xs);
  opacity: 0; transition: opacity 0.15s, background 0.15s;
  color: var(--text-dim);
  line-height: 1;
}
.tag-dd-item:hover .tag-dd-action { opacity: 0.7; }
.tag-dd-action:hover { opacity: 1 !important; background: rgba(var(--primary-rgb),0.15); }
.tag-dd-del:hover { color: var(--color-danger) !important; background: rgba(var(--color-danger-rgb),0.12) !important; }
.tag-dd-sep {
  height: 1px;
  background: rgba(var(--primary-rgb),0.15);
  margin: 4px 6px;
}
.tag-dd-mode {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px;
  font-size: var(--fs-sm);
}
.tag-dd-mode-label { color: var(--text-dim); flex-shrink: 0; }
.tag-dd-mode-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 2px 8px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-family: inherit;
  transition: 0.2s;
}
.tag-dd-mode-btn:hover { border-color: var(--primary); color: var(--text-main); }
.tag-dd-mode-btn.active {
  background: var(--primary);
  color: var(--text-on-primary, #fff);
  border-color: var(--primary);
}
body.light-mode .search-input-tokens-wrap {
  background: rgba(0,0,0,0.04) !important;
  border-color: rgba(0,0,0,0.12) !important;
}
body.light-mode .search-input-tokens-wrap:focus-within {
  border-color: var(--primary) !important;
}
body.light-mode .tag-dropdown-panel {
  background: var(--card-bg-solid) !important;
  border-color: rgba(0,0,0,0.12) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
}
body.light-mode .tag-dropdown-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
body.light-mode .tag-dropdown-panel::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }
body.light-mode .tag-dd-item { color: var(--text-main) !important; }
body.light-mode .tag-dd-item:hover { background: rgba(var(--primary-rgb),0.1) !important; }
body.light-mode .tag-dd-mode-btn {
  background: rgba(0,0,0,0.04) !important;
  color: var(--text-muted) !important;
  border-color: rgba(0,0,0,0.12) !important;
}
body.light-mode .tag-dd-mode-btn:hover {
  border-color: var(--primary) !important;
  color: var(--text-main) !important;
}
body.light-mode .tag-dd-mode-btn.active {
  background: var(--primary) !important;
  color: var(--text-on-primary, #fff) !important;
}
.note-modified-date {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  opacity: 0.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  margin-top: -1px;
}
.note-excerpt {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  opacity: 0.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  margin-top: 1px;
  display: block;
  max-width: 100%;
}
.tree-item .note-title-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tree-item .note-title-group .note-title {
  flex: initial;
}
.search-hint-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  flex-shrink: 0;
}
.search-hint-btn:hover {
  background: rgba(var(--primary-rgb),0.15);
  color: var(--primary-light);
  border-color: rgba(var(--primary-rgb),0.4);
}
.search-hints-popup {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  background: var(--card-bg-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: gn-popup-in 0.15s ease;
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.search-hints-popup .hint-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.search-hints-popup .hint-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 2px 0;
}
.search-hints-popup .hint-code {
  font-family: var(--font-mono);
  background: rgba(var(--primary-rgb),0.1);
  border: 1px solid rgba(var(--primary-rgb),0.2);
  border-radius: var(--radius-xs);
  padding: 1px 6px;
  font-size: var(--fs-sm);
  color: var(--primary-light);
  white-space: nowrap;
  flex-shrink: 0;
}
.search-hints-popup .hint-desc {
  color: var(--text-dim);
  font-size: var(--fs-sm);
}
body.light-mode .search-hints-popup {
  background: var(--card-bg-solid);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.note-preview-tooltip {
  position: fixed;
  z-index: var(--z-dropdown);
  max-width: 290px;
  padding: 12px 14px;
  background: var(--card-bg-solid);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  color: var(--text-dim);
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  word-break: break-word;
  overflow: hidden;
}
.note-preview-tooltip.visible { opacity: 1; }
.note-preview-tooltip .np-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-preview-tooltip .np-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.note-preview-tooltip .np-tag {
  font-size: var(--fs-xs);
  color: var(--secondary);
  background: rgba(var(--secondary-rgb), 0.12);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}
.note-preview-tooltip .np-body {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  line-height: 1.5;
  max-height: 72px;
  overflow: hidden;
}
.note-preview-tooltip .np-body--empty {
  opacity: 0.4;
  font-style: italic;
}
.note-preview-tooltip .np-footer {
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 6px;
}
.note-preview-tooltip .np-date {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  opacity: 0.7;
}
body.light-mode .note-preview-tooltip {
  background: var(--card-bg-solid);
  border-color: rgba(0,0,0,0.1);
  color: var(--text-main);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
body.light-mode .note-preview-tooltip .np-title {
  color: var(--primary);
}
body.light-mode .note-preview-tooltip .np-tag {
  background: rgba(var(--secondary-rgb),0.08);
}
body.light-mode .note-preview-tooltip .np-footer {
  border-top-color: rgba(0,0,0,0.06);
}
.folder-empty-placeholder {
  padding: 12px 16px;
  margin: 4px 8px;
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: var(--radius-base);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-base);
  opacity: 0.6;
}
.folder-empty-placeholder.drop-target {
  border-color: var(--primary);
  opacity: 1;
  background: rgba(var(--primary-rgb),0.08);
}
body.light-mode .folder-empty-placeholder {
  border-color: rgba(0,0,0,0.15);
}
.save-search-btn {
  background: none;
  border: 1px solid rgba(var(--primary-rgb),0.3);
  color: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-base);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.save-search-btn:hover {
  background: rgba(var(--primary-rgb),0.15);
  border-color: rgba(var(--primary-rgb),0.5);
}
.saved-search-item {
  display: flex;
  align-items: center;
  width: calc(100% - 16px);
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: var(--radius-base);
  cursor: pointer;
  font-size: var(--fs-base);
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
  margin: 2px 8px 0;
}
.saved-search-item:hover {
  background: rgba(var(--primary-rgb),0.1);
}
.saved-search-item.sf-active {
  background: rgba(var(--primary-rgb),0.15);
  border-color: rgba(var(--primary-rgb),0.4);
  color: var(--primary-light);
}
.saved-search-item.sf-add-btn {
  opacity: 0.7;
  border-style: dashed;
  border-color: rgba(var(--primary-rgb),0.2);
}
.saved-search-item.sf-add-btn:hover {
  opacity: 1;
  border-color: rgba(var(--primary-rgb),0.4);
}
.saved-search-badge {
  background: rgba(var(--primary-rgb),0.15);
  color: var(--primary-light);
  border-radius: var(--radius-pill);
  padding: 1px 6px;
  font-size: var(--fs-sm);
  flex-shrink: 0;
}
.bulk-tag-popup {
  position: fixed;
  z-index: var(--z-modal);
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 12px;
  width: 260px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
}
.bulk-tag-popup .btag-input {
  width: 100%;
  padding: 6px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-base);
  color: var(--text-main);
  font-size: var(--fs-base);
  outline: none;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.bulk-tag-popup .btag-input::placeholder {
  color: var(--text-muted);
}
.bulk-tag-popup label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text-dim);
  transition: background 0.12s;
}
.bulk-tag-popup label:hover {
  background: rgba(var(--primary-rgb),0.1);
}
.bulk-tag-popup input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
}
body.light-mode .bulk-tag-popup {
  background: var(--card-bg-solid);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
body.light-mode .bulk-tag-popup label {
  color: var(--text-main);
}
body.light-mode .bulk-tag-popup .btag-input {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.15);
  color: var(--text-main);
}
.breadcrumbs-bar {
  padding: 2px 12px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 14px;
}
.breadcrumbs-bar .bc-folder {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.breadcrumbs-bar .bc-folder:hover {
  opacity: 1;
  color: var(--primary);
}
.breadcrumbs-bar .bc-sep { opacity: 0.4; }
.breadcrumbs-bar .bc-note { opacity: 0.9; }
body.light-mode .breadcrumbs-bar {
  border-bottom-color: rgba(0,0,0,0.06);
}
.folder-emoji-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--fs-sm);
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.folder-item:hover .folder-emoji-btn {
  opacity: 0.6;
}
.folder-emoji-btn:hover {
  opacity: 1 !important;
}
.folder-emoji-picker {
  position: fixed;
  z-index: var(--z-modal);
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 220px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.folder-emoji-picker span {
  cursor: pointer;
  font-size: var(--fs-lg);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.folder-emoji-picker span:hover {
  background: rgba(var(--primary-rgb),0.2);
}
body.light-mode .folder-emoji-picker {
  background: rgba(255,255,255,0.97);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.folder-more-btn,
.note-more-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--fs-base);
  padding: 2px 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  color: var(--text-dim);
  letter-spacing: 1px;
  flex-shrink: 0;
  margin-left: auto;
}
.folder-item:hover .folder-more-btn,
.tree-item:hover .note-more-btn {
  visibility: visible;
  opacity: 0.6;
}
.folder-more-btn:hover,
.note-more-btn:hover {
  opacity: 1 !important;
  color: var(--primary-light);
}
body.light-mode .folder-item:hover .folder-more-btn,
body.light-mode .tree-item:hover .note-more-btn {
  color: var(--text-muted);
}
body.light-mode .folder-more-btn:hover,
body.light-mode .note-more-btn:hover {
  color: var(--primary) !important;
}
body.light-mode .saved-search-item.sf-active {
  background: rgba(var(--primary-rgb),0.12);
  border-color: rgba(var(--primary-rgb),0.35);
}
body.light-mode .saved-search-badge {
  background: rgba(var(--primary-rgb),0.12);
}
body.light-mode .note-color-picker {
  background: var(--card-bg-solid);
  border-color: var(--glass-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.section-label--nav { border-bottom: 2px solid rgba(var(--primary-rgb),0.35); padding-bottom: 8px; margin-bottom: 6px; }
.section-label-back { cursor: pointer; float: right; font-size: var(--fs-sm); opacity: 0.6; }
.section-label--flex { display: flex; align-items: center; justify-content: space-between; padding-right: 8px; }
.sidebar-lazy-indicator { padding: 8px; font-size: var(--fs-sm); }
      .sf-active-bar {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        margin: 0 6px 6px;
        background: rgba(var(--primary-rgb), 0.12);
        border: 1px solid rgba(var(--primary-rgb), 0.3);
        border-radius: var(--radius-base);
        font-size: var(--fs-base);
        color: var(--primary-light);
      }
      .sf-clear-btn {
        border: none;
        background: none;
        color: var(--primary-light);
        cursor: pointer;
        font-size: var(--fs-md);
        padding: 0 2px;
        opacity: 0.7;
      }
      .sf-clear-btn:hover { opacity: 1; }
      .sf-add-btn {
        display: flex;
        align-items: center;
        width: calc(100% - 16px);
        background: none;
        border: none;
        color: var(--text-dim);
        padding: 4px 8px;
        border-radius: var(--radius-base);
        cursor: pointer;
        font-size: var(--fs-base);
        gap: 6px;
        transition: background 0.15s;
        text-align: left;
        margin: 2px 8px 0;
      }
      .sf-add-btn:hover { background: rgba(255,255,255,0.06); }
      .sf-select {
        padding: 6px 8px;
        border-radius: var(--radius-base);
        border: 1px solid var(--glass-border);
        background: var(--input-bg);
        color: var(--text-main);
        font-size: var(--fs-base);
        font-family: inherit;
        box-sizing: border-box;
      }
      body.light-mode .sf-select { background: var(--bg); border-color: rgba(0,0,0,0.12); color: var(--text-main); }
      .sf-rule-row {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 8px;
        flex-wrap: wrap;
      }
      .sf-modal-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 16px;
      }
      .sf-modal-title {
        font-size: var(--fs-md);
        font-weight: 600;
        color: var(--text-main);
      }
      .sf-name-row { margin-bottom: 14px; }
      .sf-logic-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
      }
      .sf-logic-toggle {
        padding: 4px 12px;
        border-radius: var(--radius-sm);
        border: 1px solid rgba(var(--primary-rgb), 0.3);
        background: rgba(var(--primary-rgb), 0.1);
        color: var(--primary-light);
        cursor: pointer;
        font-size: var(--fs-base);
        font-family: inherit;
      }
      .sf-del-rule {
        width: 26px;
        height: 26px;
        border-radius: var(--radius-sm);
        border: 1px solid rgba(var(--color-danger-rgb),0.3);
        background: rgba(var(--color-danger-rgb),0.1);
        color: var(--color-danger);
        cursor: pointer;
        font-size: var(--fs-md);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
      }
      .sf-del-rule:hover { background: rgba(var(--color-danger-rgb),0.2); }
      .sf-add-rule {
        margin: 8px 0 16px;
        padding: 6px 14px;
        border-radius: var(--radius-base);
        border: 1px dashed rgba(var(--primary-rgb), 0.4);
        background: transparent;
        color: var(--primary-light);
        cursor: pointer;
        font-size: var(--fs-base);
        font-family: inherit;
      }
      .sf-add-rule:hover { border-color: rgba(var(--primary-rgb), 0.7); }

/* ── Version History (app.js) ────────────────────────────────── */

      .vh-box {
        background: var(--card-bg-solid);
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: var(--radius-md);
        width: min(860px, 95vw);
        height: min(580px, 90vh);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-shadow: 0 24px 64px rgba(0,0,0,0.6);
      }
      .vh-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        flex-shrink: 0;
      }
      .vh-body {
        display: flex;
        flex: 1;
        overflow: hidden;
      }
      .vh-list {
        width: 220px;
        flex-shrink: 0;
        border-right: 1px solid rgba(255,255,255,0.07);
        overflow-y: auto;
        padding: 10px 8px;
      }
      .vh-diff {
        flex: 1;
        overflow-y: auto;
        padding: 12px 14px;
      }
      .vh-footer {
        padding: 12px 20px;
        border-top: 1px solid rgba(255,255,255,0.08);
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
      }
      .vh-restore-btn {
        padding: 7px 16px;
        border-radius: var(--radius-base);
        border: none;
        background: var(--primary);
        color: var(--text-main);
        cursor: pointer;
        font-size: var(--fs-base);
        transition: 0.15s;
      }
      .vh-restore-btn:hover { background: var(--primary); }
      .vh-item {
        padding: 9px 10px;
        border: 1px solid rgba(255,255,255,0.06);
        border-radius: var(--radius-base);
        margin: 0 0 5px;
        cursor: pointer;
        font-size: var(--fs-sm);
        transition: 0.15s;
      }
      .vh-item:hover { background: rgba(255,255,255,0.06); }
      .vh-item--active {
        border-color: var(--primary);
        background: rgba(var(--primary-rgb), 0.1);
      }
      body.light-mode .vh-box { background: var(--card-bg-solid); border-color: rgba(0,0,0,0.12); box-shadow: 0 24px 64px rgba(0,0,0,0.15); }
      body.light-mode .vh-header { border-bottom-color: rgba(0,0,0,0.08); }
      body.light-mode .vh-list { border-right-color: rgba(0,0,0,0.06); }
      body.light-mode .vh-footer { border-top-color: rgba(0,0,0,0.08); }
      body.light-mode .vh-item { border-color: rgba(0,0,0,0.06); }
      body.light-mode .vh-item:hover { background: rgba(0,0,0,0.04); }
/* Unified diff lines */
.vh-diff-line { font-family: monospace; font-size: var(--fs-sm); padding: 1px 8px; white-space: pre-wrap; word-break: break-all; display: flex; align-items: baseline; gap: 0; }
.vh-diff-line--add { background: rgba(34,197,94,0.15); color: #86efac; border-left: 2px solid var(--color-success); }
.vh-diff-line--del { background: rgba(var(--color-danger-rgb),0.15); color: #fca5a5; border-left: 2px solid var(--color-danger); }
.vh-diff-line--eq  { color: var(--text-muted); }
.vh-diff-empty { color: var(--text-muted); padding: 20px; text-align: center; }
.vh-diff-num { display: inline-block; width: 52px; flex-shrink: 0; text-align: right; padding-right: 8px; color: var(--text-muted); opacity: 0.5; font-size: var(--fs-xs); user-select: none; }
body.light-mode .vh-diff-line--add { background: rgba(34,197,94,0.08); color: #166534; border-left-color: var(--color-success); }
body.light-mode .vh-diff-line--del { background: rgba(var(--color-danger-rgb),0.08); color: #991b1b; border-left-color: var(--color-danger); }
body.light-mode .vh-diff-line--eq  { color: var(--text-muted); }

/* Diff legend + stats */
.vh-diff-legend { color: var(--text-muted); font-size: var(--fs-sm); padding: 0 0 8px; border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 8px; }
.vh-diff-stats { display: flex; gap: 8px; margin-bottom: 10px; }
.vh-stat-badge { font-size: var(--fs-sm); font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); font-family: monospace; }
.vh-stat-badge--add { background: rgba(34,197,94,0.15); color: #86efac; }
.vh-stat-badge--del { background: rgba(var(--color-danger-rgb),0.15); color: #fca5a5; }
body.light-mode .vh-stat-badge--add { background: rgba(34,197,94,0.08); color: #166534; }
body.light-mode .vh-stat-badge--del { background: rgba(var(--color-danger-rgb),0.08); color: #991b1b; }
body.light-mode .vh-diff-legend { border-bottom-color: rgba(0,0,0,0.06); }

/* Toolbar (compare mode + diff toggle) */
.vh-toolbar { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 12px; }
.vh-select {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-base);
    color: var(--text-dim); font-size: var(--fs-sm); padding: 4px 8px; cursor: pointer; outline: none;
}
.vh-select:focus { border-color: var(--primary); }
body.light-mode .vh-select { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); color: var(--text-main); }
.vh-toggle-btn {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-base);
    color: var(--text-dim); font-size: var(--fs-sm); padding: 4px 10px; cursor: pointer; transition: 0.15s; white-space: nowrap;
}
.vh-toggle-btn:hover { background: rgba(var(--primary-rgb),0.15); border-color: rgba(var(--primary-rgb),0.3); }
.vh-toggle-btn--active { background: rgba(var(--primary-rgb),0.2); border-color: rgba(var(--primary-rgb),0.4); color: var(--primary-light); }
body.light-mode .vh-toggle-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); color: var(--text-main); }
body.light-mode .vh-toggle-btn:hover { background: rgba(var(--primary-rgb),0.1); }

/* Side-by-side diff */
.vh-sbs-table { display: flex; flex-direction: column; }
.vh-sbs-row { display: flex; min-height: 20px; }
.vh-sbs-cell {
    flex: 1; display: flex; align-items: baseline; font-family: monospace; font-size: var(--fs-sm);
    padding: 1px 6px; white-space: pre-wrap; word-break: break-all; min-width: 0;
}
.vh-sbs-cell--left { border-right: 1px solid rgba(255,255,255,0.06); }
.vh-sbs-num { display: inline-block; width: 28px; flex-shrink: 0; text-align: right; padding-right: 6px; color: var(--text-muted); opacity: 0.5; font-size: var(--fs-xs); user-select: none; }
.vh-sbs-text { flex: 1; min-width: 0; }
.vh-sbs-cell--eq  { color: var(--text-muted); }
.vh-sbs-cell--del { background: rgba(var(--color-danger-rgb),0.12); color: #fca5a5; }
.vh-sbs-cell--add { background: rgba(34,197,94,0.12); color: #86efac; }
.vh-sbs-cell--empty { background: rgba(255,255,255,0.02); }
body.light-mode .vh-sbs-cell--left { border-right-color: rgba(0,0,0,0.06); }
body.light-mode .vh-sbs-cell--del { background: rgba(var(--color-danger-rgb),0.06); color: #991b1b; }
body.light-mode .vh-sbs-cell--add { background: rgba(34,197,94,0.06); color: #166534; }
body.light-mode .vh-sbs-cell--empty { background: rgba(0,0,0,0.01); }
body.light-mode .vh-sbs-cell--eq { color: var(--text-muted); }

      /* ── Folder Picker ──────────────────────────────── */
      .folder-picker { flex-shrink: 0; }
      .folder-picker-btn {
        display: flex; align-items: center; gap: 5px;
        background: rgba(255,255,255,0.04);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-base);
        padding: 4px 10px;
        color: var(--text-dim);
        cursor: pointer;
        font-size: var(--fs-base);
        font-family: inherit;
        transition: 0.2s;
        white-space: nowrap;
      }
      .folder-picker-btn:hover { border-color: var(--primary); color: var(--text-main); }
      .folder-picker-dropdown {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: 4px;
        background: var(--card-bg);
        border: 1px solid rgba(var(--primary-rgb),0.3);
        border-radius: var(--radius-md);
        padding: 4px;
        min-width: 180px;
        max-height: 240px;
        overflow-y: auto;
        z-index: var(--z-sticky);
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
      }
      .folder-picker-dropdown::-webkit-scrollbar { width: 6px; }
      .folder-picker-dropdown::-webkit-scrollbar-track { background: transparent; }
      .folder-picker-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: var(--radius-xs); }
      .folder-picker-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
      body.light-mode .folder-picker-dropdown::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
      body.light-mode .folder-picker-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }
      .folder-picker-dropdown.open { display: block; }
      .fp-item {
        display: flex; align-items: center; gap: 6px;
        padding: 7px 10px;
        border-radius: var(--radius-base);
        border: none;
        background: none;
        color: var(--text-main);
        cursor: pointer;
        font-size: var(--fs-base);
        width: 100%;
        text-align: left;
        font-family: inherit;
        transition: background 0.15s;
      }
      .fp-item:hover { background: rgba(var(--primary-rgb),0.12); }
      .fp-item.active { background: rgba(var(--primary-rgb),0.2); color: var(--primary-light); }
      .fp-dot {
        width: 8px; height: 8px;
        border-radius: var(--radius-full);
        flex-shrink: 0;
      }
      body.light-mode .folder-picker-btn {
        background: rgba(0,0,0,0.04) !important;
        color: var(--text-muted) !important;
        border-color: rgba(0,0,0,0.12) !important;
      }
      body.light-mode .folder-picker-btn:hover {
        border-color: var(--primary) !important;
        color: var(--text-main) !important;
      }
      body.light-mode .folder-picker-dropdown {
        background: var(--card-bg-solid) !important;
        border-color: rgba(0,0,0,0.12) !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
      }
      body.light-mode .fp-item {
        color: var(--text-main) !important;
      }
      body.light-mode .fp-item:hover {
        background: rgba(var(--primary-rgb),0.1) !important;
      }
      body.light-mode .fp-item.active {
        background: rgba(var(--primary-rgb),0.15) !important;
        color: var(--primary-dark) !important;
      }


      /* ── Light mode: Sidebar left ── */
      body.light-mode .sidebar-left {
        background: var(--bg) !important;
      }
      body.light-mode .sidebar-label {
        color: var(--text-muted) !important;
      }
      body.light-mode .sidebar-resize-handle::after {
        background: rgba(0,0,0,0.1) !important;
      }
      body.light-mode .sidebar-resize-handle:hover::after,
      body.light-mode .sidebar-resize-handle.active::after {
        background: rgba(var(--primary-rgb),0.5) !important;
      }
      body.light-mode .folder-count {
        color: var(--text-muted) !important;
      }
      body.light-mode .notes-list::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.12) !important;
      }


      /* ── Light mode: Tab bar ── */
      body.light-mode .tab-bar {
        background: var(--bg) !important;
      }
      body.light-mode .tab-item {
        background: rgba(0,0,0,0.03) !important;
        color: var(--text-muted) !important;
        border-color: rgba(0,0,0,0.08) !important;
      }
      body.light-mode .tab-item:hover {
        background: rgba(var(--primary-rgb),0.08) !important;
        color: var(--text-main) !important;
      }
      body.light-mode .tab-item.active {
        background: rgba(var(--primary-rgb),0.12) !important;
        color: var(--text-main) !important;
        border-bottom-color: var(--primary) !important;
      }
      body.light-mode .tab-item .tab-close:hover {
        background: rgba(var(--color-danger-rgb),0.15) !important;
      }


      /* ── Light mode: Sidebar footer ── */
      body.light-mode .sidebar-footer {
        background: rgba(0,0,0,0.03) !important;
        color: var(--text-muted) !important;
      }


/* ── Moved from styles.css (base) ─────────────────────────── */
      /* Left Sidebar */
      .sidebar-left {
        padding: 1.25rem;
        position: relative;
        min-width: 200px;
        max-width: 600px;
      }
      .sidebar-resize-handle {
        position: absolute;
        top: 0;
        right: -6px;
        width: 12px;
        height: 100%;
        cursor: col-resize;
        z-index: var(--z-sidebar);
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .sidebar-resize-handle::after {
        content: '';
        width: 3px;
        height: 40px;
        border-radius: var(--radius-xs);
        background: rgba(255,255,255,0.08);
        transition: background 0.2s, height 0.2s;
      }
      .sidebar-resize-handle:hover::after,
      .sidebar-resize-handle.active::after {
        background: rgba(var(--primary-rgb),0.5);
        height: 60px;
      }
      body.sidebar-resizing {
        cursor: col-resize !important;
        user-select: none !important;
      }
      body.sidebar-resizing * {
        cursor: col-resize !important;
      }
      .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
      }
      .sidebar-label {
        font-size: var(--fs-sm);
        color: var(--text-dim);
        letter-spacing: 0.1em;
      }
      .sidebar-footer {
        margin-top: auto;
        padding: 0.75rem;
        background: rgba(255, 255, 255, 0.02);
        border-radius: var(--radius-md);
        font-size: var(--fs-sm);
        color: var(--text-dim);
        display: flex;
        justify-content: space-between;
      }
      body.light-mode .folder-item {
        color: var(--text-main) !important;
      }
      body.light-mode .sidebar-right { background: var(--bg) !important; border-left: 1px solid rgba(0,0,0,0.08) !important; color: var(--text-main) !important; }
      body.light-mode .sidebar-right::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); }
      body.light-mode .sidebar-right::-webkit-scrollbar-track { background: transparent; }
.sidebar-actions-bar {
    display: flex;
    gap: 6px;
    padding: 6px 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.sidebar-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
body.light-mode .sidebar-actions-bar { border-top-color: rgba(0,0,0,0.08); }

/* ── Focus-visible (a11y) ─────────────────── */
.folder-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar-bottom-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sort-picker-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar-collapse-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar-expand-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bookmark-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tag-dd-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tag-dd-mode-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.save-search-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.saved-search-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sf-logic-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sf-del-rule:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sf-add-rule:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vh-restore-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vh-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vh-toggle-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.folder-picker-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.fp-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.folder-emoji-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.folder-more-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.note-more-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sf-clear-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.search-hint-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
