.tags-title {
  font-family: var(--editor-font-family);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.tags-empty {
  text-align: center;
  color: #666;
  font-family: var(--editor-font-family);
  font-style: italic;
}

.tags-container {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0 1rem;
}

.tag-item-wrapper {
  margin-left: 0;
}

.tag-item-wrapper.level-1 {
  margin-left: 1.5rem;
}

.tag-item-wrapper.level-2 {
  margin-left: 3rem;
}

.tag-item-wrapper.level-3 {
  margin-left: 4.5rem;
}

.tag-item-wrapper.level-4 {
  margin-left: 6rem;
}

.tag-item-wrapper.level-5 {
  margin-left: 7.5rem;
}

.tag-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px dotted #e0e0e0;
  gap: 0.5rem;
}

.tag-expand-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.tag-spacer {
  width: 1rem;
}

.tag-edit-input {
  flex: 1;
  padding: 0.25rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: var(--editor-font-family);
  font-size: 0.9rem;
}

.tag-name {
  flex: 1;
  font-family: var(--editor-font-family);
  font-size: 0.9rem;
}

.tag-name.level-0 {
  font-weight: 500;
}

.tag-name.level-nested {
  font-weight: 400;
}

.tag-count {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
  min-width: 2rem;
  text-align: right;
}

.tag-action-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  color: #666;
}

.tag-action-button.delete {
  color: #dc2626;
}
.stats-grid {
  display: grid;
  gap: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.stat-item.warning {
  background-color: #fff3cd;
  border-color: #ffc107;
}

.stat-icon {
  flex-shrink: 0;
}

.stat-icon.notebooks {
  color: #007bff;
}

.stat-icon.notes {
  color: #28a745;
}

.stat-icon.words {
  color: #6f42c1;
}

.stat-icon.empty {
  color: #dc3545;
}

.stat-label {
  font-size: 0.875rem;
  color: #6c757d;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.stat-value.warning {
  color: #dc3545;
}
.data-folder-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.data-folder-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f5f5f5;
}

.data-folder-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.data-folder-button:hover {
  background-color: #0056b3;
}

.data-folder-help {
  color: #666;
  margin-top: 0.5rem;
  display: block;
}
/* Modal overlay with fade animation */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

/* Modal container with slide animation */
.modal {
  background: var(--color-white);
  border-radius: 1rem;
  width: 90%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
  border: 1px solid var(--color-border);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.8);
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--color-text);
}

.modal-content {
  padding: 1.5rem;
}

/* Modern tab design */
.modal-tabs {
  display: flex;
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.8);
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--color-border);
  gap: 0.5rem;
  overflow-x: auto;
}

.modal-tab {
  padding: 1rem 1.5rem;
  border: none;
  background: none;
  color: var(--color-text-light);
  cursor: pointer;
  font-size: 0.875rem;
  position: relative;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
}

.modal-tab:hover {
  color: var(--color-text);
}

.modal-tab.active {
  color: var(--color-text);
  font-weight: 500;
}

.modal-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 1px;
  transition: all 0.2s ease;
}

/* Settings groups */
.settings-group {
  margin-bottom: 2rem;
  background: var(--color-white);
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-group h3 {
  margin: 0 0 1.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 1rem;
}

.setting-item:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.setting-item label {
  font-size: 0.875rem;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 500;
  display: flex;
  align-items: center;
}

/* Form controls */
.setting-item select,
.modal select,
.modal input[type="text"],
.modal input[type="password"],
.modal input[type="number"] {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-white);
  font-size: 0.875rem;
  color: var(--color-text);
  min-width: 120px;
  font-family: 'Outfit', system-ui, sans-serif;
  transition: all 0.2s ease;
}

.setting-item select:hover,
.modal select:hover,
.modal input[type="text"]:hover,
.modal input[type="password"]:hover,
.modal input[type="number"]:hover {
  border-color: var(--color-text-light);
}

.setting-item select:focus,
.modal select:focus,
.modal input[type="text"]:focus,
.modal input[type="password"]:focus,
.modal input[type="number"]:focus {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 2px rgba(41, 37, 36, 0.1);
}

/* Buttons */
.button-primary,
.button-danger {
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Outfit', system-ui, sans-serif;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.button-primary {
  background-color: var(--color-button);
  color: var(--color-white);
  border: none;
}

.button-primary:hover:not(:disabled) {
  background-color: var(--color-button-hover);
  transform: translateY(-1px);
}

.button-primary:active:not(:disabled) {
  transform: translateY(0);
}

.button-danger {
  background-color: var(--color-danger);
  color: var(--color-white);
  border: none;
}

.button-danger:hover {
  filter: brightness(90%);
  transform: translateY(-1px);
}

.button-danger:active {
  transform: translateY(0);
}

/* Modal animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Status messages */
.import-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  animation: fadeIn 0.2s ease;
}

.import-status.success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.import-status.error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Pin input group */
.pin-input-group {
  display: flex;
  gap: 0.75rem;
}

.pin-input {
  flex: 1;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
  transition: all 0.2s ease;
}

.pin-input:focus {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 2px rgba(41, 37, 36, 0.1);
}

/* Censorship status */
.censorship-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
  border: 1px solid var(--color-border);
}

/* Modal actions */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* OCR specific styles */
.ocr-preview {
  margin-bottom: 1.5rem;
  text-align: center;
}

.ocr-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background-color: var(--color-bg);
  border-radius: 0.5rem;
  margin: 1rem 0;
  font-size: 0.875rem;
  color: var(--color-text);
}

.ocr-result {
  margin-top: 1.5rem;
}

.ocr-result label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.ocr-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
  resize: vertical;
  min-height: 120px;
}

.ocr-textarea:focus {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 2px rgba(41, 37, 36, 0.1);
}

.language-select {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-white);
  font-size: 0.875rem;
  color: var(--color-text);
  min-width: 200px;
  font-family: 'Outfit', system-ui, sans-serif;
  transition: all 0.2s ease;
}

.language-select:hover {
  border-color: var(--color-text-light);
}

.language-select:focus {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 2px rgba(41, 37, 36, 0.1);
}

/* Spinner animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}
.notebook-input,
.notebook-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text);
  margin-top: 0.25rem;
}

.notebook-input:focus,
.notebook-select:focus {
  outline: none;
  border-color: var(--color-text-light);
}.notebook-item {
  margin-bottom: 0.5rem;
}

.notebook-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  border-radius: 0.5rem;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.notebook-header.focused {
  background-color: var(--color-bg);
  font-weight: 600;
  border-left: 3px solid var(--color-text);
  padding-left: calc(0.25rem - 3px);
}

.notebook-header:hover {
  background-color: var(--color-bg);
}

.notebook-toggle {
  padding: 0.25rem;
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notebook-name {
  font-family: var(--sidebar-font-family), Georgia, serif;
  font-size: calc(var(--sidebar-font-size) * 1.15);
  color: var(--color-text);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0.7;
  max-width: 75%;
}

.notebook-name:hover {
  background-color: var(--color-bg);
}

.notebook-context-menu {
  background: var(--color-white);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
  overflow: hidden;
  z-index: 50;
  animation: dropdownFade 0.2s ease;
  min-width: 160px;
}

.notebook-context-menu-item {
  width: 100%;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: none;
  background: none;
  color: var(--color-text);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notebook-context-menu-item:hover {
  background-color: var(--color-bg);
}

.notebook-context-menu-item:active {
  background-color: var(--color-border);
}.note-item {
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

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

.note-item.selected {
    background-color: var(--color-bg);
    border-left: 3px solid var(--color-text);
    padding-left: calc(0.75rem - 3px);
}

.note-item.selected .note-item-title {
    font-weight: 600;
}

.note-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-item-header .lucide-lock {
    color: var(--color-text-light);
}

.note-item-title {
    font-family: var(--sidebar-font-family), Georgia, serif;
    font-size: var(--sidebar-font-size);
    font-weight: normal;
    margin: 0 0 0.25rem 0;
    color: var(--color-text);
}

.note-item-date {
    font-size: calc(var(--sidebar-font-size) * 0.75);
    color: var(--color-text-light);
}

.censorship-status {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: var(--color-bg);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-text);
    font-family: 'Inter', system-ui, sans-serif;
}

.note-item-pdf-icon {
    flex-shrink: 0;
    color: var(--color-text-light);
    opacity: 0.7;
}

.note-item--pdf .note-item-title {
    opacity: 0.85;
}

.note-item-pdf-icon {
    flex-shrink: 0;
    color: var(--color-text-light);
    opacity: 0.7;
}

.note-item--pdf .note-item-title {
    opacity: 0.85;
}.sidebar {
    width: 256px;
    background-color: var(--color-white);
    border-left: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar {
        transition: none;
    }
}

.sidebar.hidden {
    width: 0;
    padding: 0;
}

.sidebar.unpinned {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100;
    transform: translateX(100%);
}

.sidebar.unpinned.visible {
    transform: translateX(0);
}

.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    padding: 0.5rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    opacity: 0.5;
    transition: all 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-toggle {
        transition: none;
    }
}

.sidebar-toggle:hover {
    opacity: 1;
    background-color: var(--color-bg);
    color: var(--color-text);
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background-color: var(--color-white);
    position: absolute;
    right: 0;
}

.sidebar-title {
    font-family: var(--sidebar-font-family), Georgia, serif;
    font-size: calc(var(--sidebar-font-size) * 1.25);
    color: var(--color-text);
    margin: 0;
}

/* Sidebar Menu Styles */
.sidebar-menu-button {
    padding: 0.5rem;
    background: none;
    border: none;
    border-radius: 0.375rem;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-menu-button {
        transition: none;
    }
}

.sidebar-menu-button:hover {
    opacity: 1;
    background-color: var(--color-bg);
    color: var(--color-text);
}

.sidebar-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    width: 200px;
    background: var(--color-white);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--color-border);
    overflow: hidden;
    z-index: 50;
    animation: dropdownFade 0.2s ease;
}

.sidebar-dropdown-item {
    width: 100%;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    background: none;
    color: var(--color-text);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-dropdown-item {
        transition: none;
    }
}

.sidebar-dropdown-item:hover {
    background-color: var(--color-bg);
}

.sidebar-dropdown-item:active {
    background-color: var(--color-border);
}

.sidebar-dropdown-item:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
}

.notebooks-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}.tag-tree {
  margin-bottom: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.tag-tree-item {
  margin: 0.25rem 0;
}

.tag-tree-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-tree-toggle {
  padding: 0.25rem;
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag-tree-toggle:hover {
  color: var(--color-text);
}

.tag-tree-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
  cursor: pointer;
  border-radius: 0.25rem;
  flex: 1;
}

.tag-tree-label:hover {
  background-color: var(--color-bg);
}

.tag-tree-checkbox {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--color-border);
  cursor: pointer;
}

.tag-tree-children {
  margin-left: 1rem;
}

.tag-input-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tag-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text);
}

.tag-input:focus {
  outline: none;
  border-color: var(--color-text-light);
}

.tag-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.tag-apply-button {
  padding: 0.5rem 1rem;
  background-color: var(--color-button);
  color: var(--color-white);
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-apply-button:hover {
  background-color: var(--color-button-hover);
}.tag {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--color-bg);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--color-text);
}

.tag-path {
    color: var(--color-text);
}

.tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem;
    border: none;
    background: none;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: 9999px;
}

.tag-remove:hover {
    color: var(--color-danger);
    background-color: var(--color-danger-hover);
}

.add-tag-button {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: none;
    border: 1px dashed var(--color-border);
    border-radius: 9999px;
    color: var(--color-text-light);
    font-size: 0.875rem;
    cursor: pointer;
}

.add-tag-button:hover {
    background-color: var(--color-bg);
    color: var(--color-text);
}

.tag-tree {
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.tag-tree-item {
    margin: 0.25rem 0;
}

.tag-tree-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-tree-toggle {
    padding: 0.25rem;
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-tree-toggle:hover {
    color: var(--color-text);
}

.tag-tree-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 0.25rem;
    flex: 1;
}

.tag-tree-label:hover {
    background-color: var(--color-bg);
}

.tag-tree-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--color-border);
    cursor: pointer;
}

.tag-tree-children {
    margin-left: 1rem;
}

.tag-input-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tag-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-text);
}

.tag-input:focus {
    outline: none;
    border-color: var(--color-text-light);
}

.tag-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.tag-apply-button {
    padding: 0.5rem 1rem;
    background-color: var(--color-button);
    color: var(--color-white);
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tag-apply-button:hover {
    background-color: var(--color-button-hover);
}

.tags-container {
    clear: both;
}.pdf-viewer {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0;
  background-color: var(--color-bg-secondary, #e8e8e8);
}

.pdf-viewer-loading,
.pdf-viewer-error {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--color-text-light);
  font-family: var(--editor-font-family), Georgia, serif;
  font-size: 0.95rem;
  padding: 2rem;
  text-align: center;
}

.pdf-viewer-error {
  color: var(--color-error, #b91c1c);
}

.pdf-page-container {
  position: relative;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  background: white;
}

.pdf-page-container canvas {
  display: block;
}

.pdf-page-container .annotation-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pdf-page-container .annotation-layer section {
  pointer-events: auto;
}

.pdf-page-number {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  font-family: var(--editor-font-family), Georgia, serif;
}
.editor {
  max-width: var(--editor-width);
  width: var(--editor-width);
  margin: 0 auto;
  height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
}

.editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.editor-toolbar {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--color-white);
  border-radius: 9999px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 50;
  transition: all 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    .editor-toolbar {
        transition: none;
    }
}

.note-navigation {
    flex-direction: row;
    display: flex;
    justify-self: anchor-center;
}

.editor-toolbar:hover {
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    .editor-toolbar:hover {
        transform: none;
    }
}

.editor-toolbar .toggle-button {
  z-index: 2;
  align-self: end;
}

.editor-toolbar .toolbar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    .editor-toolbar .toolbar-actions {
        transition: none;
    }
}

.editor-toolbar.expanded {
  padding: 0.75rem 1rem;
}

.editor-toolbar.expanded .toolbar-actions {
  opacity: 1;
  width: auto;
  height: auto;
  overflow: visible;
}

.editor-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  width: 102%;
  box-sizing: border-box;
  text-wrap: balance;
}

.editor-content img {
  max-height: 60vh;
  display: block;
  margin: 1rem auto;
  transition: max-width 0.3s ease;
}

.editor.annotated img.annotation-image {
  max-height: fit-content;
}

.editor-content img.full-width {
  max-width: 100%;
  max-height: initial;
}

/* Annotated layout styles */
.editor.annotated {
  max-width: 100%;
  width: 100%;
}

.editor.annotated .editor-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  padding: 2rem;
  height: calc(100vh - 4rem);
  overflow: hidden;
}

.editor.annotated .images-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding-right: 1rem;
  border-right: 1px solid var(--color-border);
}

.editor.annotated .text-column {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.zen-mode .editor.annotated .editor-content {
  grid-template-columns: 50% 50%;
}

.editor.annotated .add-image-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px dashed var(--color-border);
  border-radius: 0.5rem;
  background: none;
  color: var(--color-text-light);
  cursor: pointer;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.editor.annotated .add-image-button:hover {
  border-color: var(--color-text);
  color: var(--color-text);
  background: var(--color-bg);
}

.editor.annotated .annotation-image {
  width: 100%;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.editor.annotated .annotation-image:hover {
  transform: scale(1.02);
}

.editor.annotated .editor-body .ProseMirror {
  min-height: calc(100vh - 16rem);
}

.editor.annotated .editor-body .ProseMirror img {
  display: none; /* Hide images in text column for annotated layout */
}

@media (max-width: 1024px) {
  .editor.annotated .editor-content {
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .editor.annotated .editor-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .editor.annotated .images-column {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding-right: 0;
    padding-bottom: 1rem;
    max-height: 200px;
  }
}

.editor-title {
  width: 100%;
  font-size: var(--title-font-size);
  font-family: var(--title-font-family), Georgia, serif;
  background: transparent;
  border: none;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.editor-title:focus {
  outline: none;
  border-bottom-color: var(--color-text-light);
}

.editor-body {
  width: 100%;
  font-family: var(--editor-font-family), Georgia, serif;
  font-size: var(--editor-font-size);
  line-height: var(--editor-line-height);
  color: var(--color-text);
}

.editor-body .ProseMirror {
  min-height: calc(100vh - 12rem);
  outline: none;
  white-space: pre-wrap;
}

.editor-body .ProseMirror p {
  margin: 0 0 var(--paragraph-spacing) 0;
  position: relative;
}

.editor-body .ProseMirror li p {
  margin: 0;
}

.editor-body.drop-caps .ProseMirror>p:first-child::first-letter {
  font-size: var(--drop-cap-size);
  line-height: 1;
  float: left;
  margin-right: 0.25em;
  padding-top: 0;
  margin-top: 0;
}

.editor-body .ProseMirror h1 {
  font-size: 1.75em;
  margin: 1em 0 0.5em;
  clear: both;
}

.editor-body .ProseMirror h2 {
  font-size: 1.5em;
  margin: 1em 0 0.5em;
  clear: both;
}

.editor-body .ProseMirror h3 {
  font-size: 1.25em;
  margin: 1em 0 0.5em;
  clear: both;
}

.editor-body .ProseMirror p.is-editor-empty:first-child::before {
  color: var(--color-text-light);
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}

.editor-body .ProseMirror span[data-censored] {
  background-color: var(--color-text);
  color: var(--color-white);
  padding: 0 0.25em;
  border-radius: 0.125em;
  user-select: none;
}

.editor-body .paragraph-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: -0.75rem;
  margin-bottom: 0.75rem;
}

.editor-body .paragraph-tag {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  background-color: var(--color-bg);
  border-radius: 0.25rem;
  color: var(--color-text-light);
  white-space: nowrap;
}

.editor-body ul[data-type="taskList"] {
  list-style: none;
  padding: 0;
}

.editor-body ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  margin: 0.5em 0;
}

.editor-body ul[data-type="taskList"] li>label {
  margin-right: 0.5em;
}

.editor-body ul[data-type="taskList"] li>div {
  flex: 1;
}

.editor-body ul[data-type="taskList"] li input[type="checkbox"] {
  cursor: pointer;
  width: 1.25em;
  height: 1.25em;
  margin: 0.25em 0.5em 0 0;
  border: 2px solid var(--color-text-light);
  border-radius: 0.25em;
  transition: all 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .editor-body ul[data-type="taskList"] li input[type="checkbox"] {
        transition: none;
    }
}

.editor-body ul[data-type="taskList"] li input[type="checkbox"]:checked {
  background-color: var(--color-checkbox);
  border-color: var(--color-checkbox);
}

.editor-body ul[data-type="taskList"] li input[type="checkbox"]:checked+div {
  color: var(--color-text-light);
  text-decoration: line-through;
}

.image-context-menu {
  position: fixed;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 1000;
}

.image-context-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 0.25rem;
  font-family: 'Outfit', system-ui, sans-serif;
}

.image-context-menu .menu-item:hover {
  background-color: var(--color-bg);
}

.word-count {
  position: fixed;
  bottom: 2rem;
  left: calc(256px + 2rem);
  padding: 0.5rem 0.75rem;
  background: var(--color-white);
  border-radius: 9999px;
  color: var(--color-text-light);
  font-size: 0.875rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 50;
  transition: all 0.3s ease;
}

/* Button tooltip styles */
.button-icon {
  position: relative;
}

.button-icon::after {
  content: attr(title);
  position: absolute;
  right: calc(100% + 0.5rem);
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem 0.5rem;
  background: var(--color-text);
  color: var(--color-white);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.button-icon:hover::after {
  opacity: 1;
}

.button-icon.active {
  color: var(--color-button);
  background-color: var(--color-bg);
}

@media (prefers-reduced-motion: reduce) {
    .word-count {
        transition: none;
    }
}

.zen-mode .word-count {
  left: 2rem;
}

.language-selector {
  position: fixed;
  bottom: 2rem;
  left: calc(256px + 8rem);
  padding: 0.5rem;
  background: var(--color-white);
  border-radius: 9999px;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 50;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.language-selector:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.zen-mode .language-selector {
  left: 8rem;
}

.note-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.note-loading-message {
  padding: 1rem 2rem;
  background: var(--color-white);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.875rem;
}

/* Date editing styles */
.note-date-clickable {
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

.note-date-clickable:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

.date-edit-dialog {
  border: none;
  border-radius: 1rem;
  padding: 0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 400px;
  width: 90vw;
}

.date-edit-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.4);
}

.date-edit-content {
  padding: 1.5rem;
  background: var(--color-white);
  border-radius: 1rem;
}

.date-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.date-edit-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.date-edit-close {
  padding: 0.5rem;
  background: none;
  border: none;
  border-radius: 0.375rem;
  color: var(--color-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-edit-close:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

.date-edit-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.date-edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.date-edit-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.date-edit-field input {
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-white);
  font-family: 'Outfit', system-ui, sans-serif;
  transition: border-color 0.2s ease;
}

.date-edit-field input:focus {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 2px rgba(41, 37, 36, 0.1);
}

.date-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.button-secondary {
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Outfit', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.button-secondary:hover {
  background: var(--color-bg);
  border-color: var(--color-text-light);
}

.carousel-container {
  margin: 2rem 0;
  width: 100%;
  max-width: 100%;
}

.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 0px 0px -1px rgba(0, 0, 0, 0.1);
}

.carousel-slides {
  display: flex;
  overflow-x: auto;
  width: 100%;
  flex-direction: row;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

.carousel-slide {
  min-width: 98%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--color-bg);
  scroll-snap-align: center;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.pdf-settings-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-white);
  color: var(--color-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 50;
  transition: all 0.2s ease;
}

.pdf-settings-button:hover {
  color: var(--color-text);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.12);
}
.search-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-white);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
}

.search-back-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  color: var(--color-text);
  cursor: pointer;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.875rem;
}

.search-back-button:hover {
  background: var(--color-bg);
  border-color: var(--color-text-light);
}

.search-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.search-content {
  flex: 1;
  display: flex;
  gap: 2rem;
  padding: 2rem;
  overflow: hidden;
}

.search-panel {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  flex-grow: 1;
}

.search-filters-panel {
  filter: invert(0.75);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: 100%;
  overflow: auto;
}

.search-panel.collapsed {
  width: 100%;
}

.filters-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  color: var(--color-text);
  cursor: pointer;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  justify-content: space-between;
}

.filters-toggle:hover {
  background: var(--color-bg);
  border-color: var(--color-text-light);
}

.extended-search-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  cursor: pointer;
  font-family: 'Outfit', system-ui, sans-serif;
}

.extended-search-toggle__labels {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.extended-search-toggle__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.extended-search-toggle__hint {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.extended-search-toggle__switch {
  position: relative;
  flex-shrink: 0;
  width: 2.75rem;
  height: 1.5rem;
}

.extended-search-toggle__switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.extended-search-toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.extended-search-toggle__slider::before {
  content: '';
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 1.125rem;
  height: 1.125rem;
  background: var(--color-white);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.extended-search-toggle__switch input:checked + .extended-search-toggle__slider {
  background: var(--color-button);
}

.extended-search-toggle__switch input:checked + .extended-search-toggle__slider::before {
  transform: translateX(1.25rem);
}

.extended-search-toggle__switch input:focus-visible + .extended-search-toggle__slider {
  box-shadow: 0 0 0 2px rgba(41, 37, 36, 0.2);
}

.search-input-section {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 1.5rem;
}

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

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--color-text-light);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: 'Outfit', system-ui, sans-serif;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 2px rgba(41, 37, 36, 0.1);
}

.search-clear-button {
  position: absolute;
  right: 0.75rem;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  border-radius: 0.375rem;
}

.search-clear-button:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.tag-filters-section {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 1.5rem;
}

.tag-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.tag-filters-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.tag-operator-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.tag-operator-selector label {
  font-size: 0.75rem;
  color: var(--color-text-light);
  font-family: 'Outfit', system-ui, sans-serif;
}

.operator-select {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-white);
  font-family: 'Outfit', system-ui, sans-serif;
}

.active-filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag-filter-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--color-bg);
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
}

.filter-operator {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Outfit', system-ui, sans-serif;
  text-transform: uppercase;
}

.filter-tag {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.filter-operator-select {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-text);
  background: var(--color-white);
  font-family: 'Outfit', system-ui, sans-serif;
}

.filter-remove-button {
  padding: 0.25rem;
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  border-radius: 0.25rem;
}

.filter-remove-button:hover {
  background: var(--color-border);
  color: var(--color-danger);
}

.tag-selector {
  position: relative;
}

.add-tag-filter-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: 0.5rem;
  color: var(--color-text-light);
  cursor: pointer;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.875rem;
}

.add-tag-filter-button:hover {
  background: var(--color-bg);
  border-color: var(--color-text-light);
  color: var(--color-text);
}

/* Tag selector native dialog */
.tag-selector-dialog {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 0;
  background: var(--color-white);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  min-width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: visible;
}

.tag-selector-dialog::backdrop {
  background: rgba(0, 0, 0, 0.3);
}

.tag-selector-dialog-content {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.tag-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-white);
  border-radius: 1rem 1rem 0 0;
  z-index: 1;
}

.tag-selector-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--color-text);
}

.tag-selector-close {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.tag-selector-close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.tag-selector-tags {
  padding: 0.75rem;
  overflow-y: auto;
  max-height: 50vh;
}

.tag-selector-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.tag-selector-item:hover {
  background: var(--color-bg);
}

.no-tags-message {
  padding: 1rem;
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.875rem;
  font-family: 'Outfit', system-ui, sans-serif;
  margin: 0;
}

.clear-filters-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-danger);
  border: none;
  border-radius: 0.5rem;
  color: white;
  cursor: pointer;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 1rem;
}

.clear-filters-button:hover {
  background: #dc2626;
}

.search-results {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.results-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.results-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.search-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-light);
  font-family: 'Outfit', system-ui, sans-serif;
}

.search-term,
.tag-summary {
  padding: 0.25rem 0.5rem;
  background: var(--color-bg);
  border-radius: 0.25rem;
}

.combined-notes-container {
  flex: 1;
  overflow-y: auto;
}

.search-notes-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-note-item {
  font-family: var(--editor-font-family), Georgia, serif;
  font-size: var(--editor-font-size);
  line-height: var(--editor-line-height);
  color: var(--color-text);
  margin-bottom: 2rem;
}

.partial-match-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-light);
  font-family: 'Outfit', system-ui, sans-serif;
  font-style: italic;
}

.partial-content {
  position: relative;
}

/* Add ellipsis to partial content paragraphs */
.search-note-content[data-partial="true"] p::before,
.search-note-content[data-partial="true"] h1::before,
.search-note-content[data-partial="true"] h2::before,
.search-note-content[data-partial="true"] h3::before,
.search-note-content[data-partial="true"] h4::before,
.search-note-content[data-partial="true"] h5::before,
.search-note-content[data-partial="true"] h6::before,
.search-note-content[data-partial="true"] li::before {
  content: "...";
  color: var(--color-text-light);
  font-style: italic;
}

.search-note-content[data-partial="true"] p::after,
.search-note-content[data-partial="true"] h1::after,
.search-note-content[data-partial="true"] h2::after,
.search-note-content[data-partial="true"] h3::after,
.search-note-content[data-partial="true"] h4::after,
.search-note-content[data-partial="true"] h5::after,
.search-note-content[data-partial="true"] h6::after,
.search-note-content[data-partial="true"] li::after {
  content: "...";
  color: var(--color-text-light);
  font-style: italic;
}

.search-note-header {
  margin: 0 0 1rem 0;
  cursor: pointer;
}

.search-note-header:hover {
  border-color: var(--color-text-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-note-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--title-font-family), Georgia, serif;
}

.search-note-header .note-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-light);
  font-family: 'Outfit', system-ui, sans-serif;
}

.search-note-header .notebook-name,
.search-note-header .note-theme {
  padding: 0.25rem 0.5rem;
  background: var(--color-bg);
  border-radius: 0.25rem;
  font-family: 'Outfit', system-ui, sans-serif;
}

.search-note-header .note-theme {
  background: var(--color-button);
  color: var(--color-white);
}

.search-note-header .note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.search-note-header .note-tag {
  padding: 0.125rem 0.375rem;
  background: var(--color-bg);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.search-note-content {
  padding: 0 1rem;
  margin-bottom: 1rem;
}

.note-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--color-text-light);
  font-family: 'Outfit', system-ui, sans-serif;
  justify-content: center;
}

.loading-spinner-small {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-border);
  border-top: 2px solid var(--color-text-light);
  border-radius: 50%;
}

.no-content {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-light);
  font-style: italic;
}

.note-separator {
  margin: 3rem 0;
  border: none;
  border-top: 2px solid var(--color-border);
  opacity: 0.5;
}

.search-note-content h1,
.search-note-content h2,
.search-note-content h3,
.search-note-content h4,
.search-note-content h5,
.search-note-content h6 {
  margin: 1.5rem 0 0.75rem 0;
  color: var(--color-text);
}

.search-note-content p {
  margin: 0 0 var(--paragraph-spacing) 0;
}

.search-note-content img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 0.5rem;
}

.search-note-content blockquote {
  margin: 1rem 0;
  padding: 1rem;
  border-left: 4px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 0 0.5rem 0.5rem 0;
}

.search-note-content ul,
.search-note-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.search-note-content li {
  margin: 0.5rem 0;
}

.search-note-content code {
  padding: 0.125rem 0.25rem;
  background: var(--color-bg);
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
}

.search-note-content pre {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--color-bg);
  border-radius: 0.5rem;
  overflow-x: auto;
}

.search-note-content pre code {
  padding: 0;
  background: none;
  border-radius: 0;
}

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--color-text-light);
}

.no-results-icon {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-results h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.no-results p {
  margin: 0;
  font-size: 0.875rem;
  font-family: 'Outfit', system-ui, sans-serif;
}

/* Apply drop caps if enabled in theme */
.search-note-content.drop-caps p:first-child::first-letter {
  font-size: var(--drop-cap-size);
  line-height: var(--drop-cap-line-height);
  float: left;
  margin-right: 0.25em;
  padding-top: 0;
  margin-top: 0;
}

/* Task list styles */
.search-note-content ul[data-type="taskList"] {
  list-style: none;
  padding: 0;
}

.search-note-content ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  margin: 0.5em 0;
}

.search-note-content ul[data-type="taskList"] li > label {
  margin-right: 0.5em;
}

.search-note-content ul[data-type="taskList"] li > div {
  flex: 1;
}

.search-note-content ul[data-type="taskList"] li input[type="checkbox"] {
  cursor: pointer;
  width: 1.25em;
  height: 1.25em;
  margin: 0.25em 0.5em 0 0;
  border: 2px solid var(--color-text-light);
  border-radius: 0.25em;
}

.search-note-content ul[data-type="taskList"] li input[type="checkbox"]:checked {
  background-color: var(--color-checkbox);
  border-color: var(--color-checkbox);
}

.search-note-content ul[data-type="taskList"] li input[type="checkbox"]:checked + div {
  color: var(--color-text-light);
  text-decoration: line-through;
}

/* Censored text styles */
.search-note-content span[data-censored] {
  background-color: var(--color-text);
  color: var(--color-white);
  padding: 0 0.25em;
  border-radius: 0.125em;
  user-select: none;
}

/* Cut-in styles */
.search-note-content .cut-in {
  max-width: 300px;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--color-bg);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.search-note-content .cut-in.left {
  float: left;
  margin-right: 1.5rem;
}

.search-note-content .cut-in.right {
  float: right;
  margin-left: 1.5rem;
}

.search-note-content .cut-in-image {
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.search-note-content .cut-in-text {
  font-size: 0.875rem;
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
}

/* Responsive design */
@media (max-width: 1024px) {
  .search-panel {
    width: 350px;
  }
  
  .search-panel.collapsed {
    width: 180px;
  }
  
  .search-content {
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .search-content {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
  }

  .search-panel {
    width: 100%;
    max-height: none;
    overflow-y: visible;
    order: 1;
  }
  
  .search-panel.collapsed {
    width: 100%;
    max-height: 60px;
  }

  .search-filters-panel {
    height: initial;
    overflow: visible;
  }

  .combined-notes-container {
    overflow: visible;
  }

  .search-results {
    order: 2;
    overflow: visible;
  }

  .search-header {
    padding: 1rem;
  }

  .search-header h1 {
    font-size: 1.25rem;
  }
}.timeline-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-white);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
  position: sticky;
  top: 0;
  z-index: 10;
}

.timeline-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.timeline-back-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  color: var(--color-text);
  cursor: pointer;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.875rem;
}

.timeline-back-button:hover {
  background: var(--color-bg);
  border-color: var(--color-text-light);
}

.timeline-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.timeline-date-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  color: var(--color-text);
}

.date-picker-input {
  border: none;
  background: none;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
  min-width: 120px;
}

.date-picker-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}

.date-picker-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.timeline-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
  background: var(--color-bg);
}

.timeline-content {
  position: relative;
  width: 100%;
  height: 15280px; /* Adjusted for year separators + months */
  padding: 2rem 0;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding: 0 2rem;
}


.timeline-item.current {
  background: rgba(41, 37, 36, 0.05);
  border-radius: 0.5rem;
  margin: 0 1rem 2rem 1rem;
  padding: 1rem 2rem;
}

.timeline-item.year {
  justify-content: center;
  margin: 2rem 0;
  padding: 0;
}

.timeline-item.year .timeline-date {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-light);
  text-align: center;
  background: var(--color-white);
  padding: 1rem 2rem;
  border-radius: 1rem;
  border: 2px solid var(--color-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 3;
}

.timeline-item.year .timeline-date::before {
  content: '';
  position: absolute;
  left: -2rem;
  right: -2rem;
  top: 50%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--color-border), transparent);
  transform: translateY(-50%);
  z-index: -1;
}

.timeline-marker {
  position: absolute;
  left: 50%;
  width: 12px;
  height: 12px;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.timeline-marker.year {
  display: none;
}

.timeline-marker.current {
  background: var(--color-accent);
  border-color: var(--color-accent);
  width: 14px;
  height: 14px;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.timeline-content-left {
  flex: 1;
  text-align: right;
  padding-right: 2rem;
}

.timeline-content-right {
  flex: 1;
  text-align: left;
  padding-left: 2rem;
  position: relative;
}

/* Connector lines for callouts */
.timeline-content-left::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 2rem;
  height: 2px;
  background: var(--color-accent);
  transform: translateY(-50%);
  border-radius: 1px;
}

.timeline-content-right::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 2rem;
  height: 2px;
  background: var(--color-accent);
  transform: translateY(-50%);
  border-radius: 1px;
}

/* Curved connector using border-radius */
.timeline-content-left::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 1.5rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-accent);
  border-left: none;
  border-bottom: none;
  border-radius: 0 1rem 0 0;
  transform: translateY(-50%) rotate(45deg);
}

.timeline-content-right::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 1.5rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-accent);
  border-right: none;
  border-bottom: none;
  border-radius: 1rem 0 0 0;
  transform: translateY(-50%) rotate(-45deg);
}

.timeline-date {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
  margin-bottom: 0.5rem;
}


.timeline-date.current {
  color: var(--color-accent);
}

.timeline-notes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-note {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--editor-font-family), Georgia, serif;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.timeline-note:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}


.timeline-note-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  font-family: var(--title-font-family), Georgia, serif;
}

.timeline-note-preview {
  font-size: 0.875rem;
  color: var(--color-text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: italic;
}

.timeline-empty {
  color: var(--color-text-light);
  font-style: italic;
  font-size: 0.875rem;
  font-family: 'Outfit', system-ui, sans-serif;
}

.timeline-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--color-text-light);
  font-family: 'Outfit', system-ui, sans-serif;
}

.timeline-loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-border);
  border-top: 2px solid var(--color-text-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .timeline-header {
    padding: 1rem;
  }

  .timeline-header h1 {
    font-size: 1.25rem;
  }

  .timeline-item {
    flex-direction: column;
    text-align: center;
    padding: 0 1rem;
  }

  .timeline-content-left,
  .timeline-content-right {
    flex: none;
    width: 100%;
    text-align: center;
    padding: 0;
  }

  .timeline-content-left {
    margin-bottom: 1rem;
  }

  .timeline-line {
    left: 2rem;
  }

  .timeline-marker {
    left: 2rem;
  }
}.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  background: var(--color-white);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
  max-width: 24rem;
}

.toast.success {
  border-left: 4px solid #22c55e;
}

.toast.error {
  border-left: 4px solid #dc2626;
}

.toast-message {
  color: var(--color-text);
  font-size: 0.875rem;
  font-family: 'Inter', system-ui, sans-serif;
}

.toast-close {
  padding: 0.25rem;
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.toast-close:hover {
  color: var(--color-text);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}.es-root {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  padding: 4rem 2rem;
  overflow-y: auto;
}

.es-inner {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.es-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.es-section-saved-filters {
  
}

.es-section-title {
  font-family: var(--sidebar-font-family, serif);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

/* Filter cards */
.es-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.es-filter-card {
  display: flex;
  align-items: flex-end;
  border: none;
  border-radius: 6px;
  padding: 0;
  min-height: 96px;
  max-height: 150px;
  cursor: pointer;
  text-align: left;
  transition: box-shadow 0.18s, transform 0.12s, filter 0.18s;
  position: relative;
  overflow: hidden;
}

.es-filter-bg {
  width: 100%;
  height: 100%;
}

.es-filter-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
  transform: translateY(-2px);
  filter: brightness(0.97);
}

.es-filter-label {
  font-family: var(--sidebar-font-family, serif);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
  position: absolute;
  bottom: 0.5rem;
  left: 1rem;
  right: 1rem;
  font-size: x-large;
}

.es-filter-delete {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.es-filter-card:hover .es-filter-delete {
  opacity: 1;
}

.es-filter-delete:hover {
  background: rgba(0, 0, 0, 0.5);
}

.es-filter-edit {
  position: absolute;
  top: 0.375rem;
  right: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.es-filter-card:hover .es-filter-edit {
  opacity: 1;
}

.es-filter-edit:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* Tag tree */
.es-tag-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.es-tag-item {
  display: flex;
  flex-direction: column;
}

.es-tag-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0;
}

.es-tag-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 0;
  border-radius: 2px;
  transition: color 0.1s;
}

.es-tag-expand:hover {
  color: var(--color-text);
}

.es-tag-expand--spacer {
  cursor: default;
  pointer-events: none;
}

.es-tag-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--sidebar-font-family, serif);
  font-size: 0.9375rem;
  color: var(--color-text);
  text-align: left;
  line-height: 1.5;
  border-bottom: 1px solid transparent;
  transition: border-color 0.1s, color 0.1s;
}

.es-tag-link:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

.es-tag-children {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
  display: flex;
  flex-direction: column;
}

/* Actions */
.es-actions {
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .es-root {
    padding: 2rem 1rem;
  }

  .es-filters-grid {
    grid-template-columns: 1fr;
  }
}
:root {
  --color-bg: #fafaf9;
  --color-white: #ffffff;
  --color-border: #e7e5e4;
  --color-text: #292524;
  --color-text-light: #78716c;
  --color-button: #292524;
  --color-button-hover: #44403c;
  --color-danger: #dc2626;
  --color-danger-hover: #fee2e2;
  --color-disabled: #d6d3d1;
  --color-checkbox: #22c55e;
  --color-checkbox-bg: #dcfce7;
  
  /* Typography settings */
  --editor-font-family: 'Crimson Pro';
  --editor-font-size: 1.125rem;
  --editor-line-height: 1.75;
  --title-font-family: 'Kaligrafica';
  --title-font-size: 2rem;
  --sidebar-font-family: 'Crimson Pro';
  --sidebar-font-size: 1rem;
  --page-margins: 2rem;
  --paragraph-spacing: 1em;
  --drop-cap-size: 3.5em;
  --drop-cap-line-height: 3.5;
  --editor-width: 75%;
}

@font-face {
  font-family: 'GNU Typewriter';
  src: url('./gtw-D1JmzHBQ.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'CMTypewriter';
  src: url('./cmunvt-H8P7pa0q.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'CMTypewriter';
  src: url('./cmunvi-D9Bdgbxe.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: 'UMTypewriter';
  src: url('./UMTypewriter-Regular-BqAlXE1N.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'UMTypewriter';
  src: url('./UMTypewriter-Italic-CgSbRYVd.otf') format('opentype');
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: 'UMTypewriter';
  src: url('./UMTypewriter-Bold-Lfk__KIX.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'UMTypewriter';
  src: url('./UMTypewriter-BoldItalic-Dxkp4fOm.otf') format('opentype');
  font-weight: bold;
  font-style: italic;
}

@font-face {
  font-family: 'Kaligrafica';
  src: url('./kaligrafica-B8KCOmGs.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

body {
  margin: 0;
  font-family: 'Outfit', system-ui, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: row-reverse;
}

.app.zen-mode .main-content {
  background-color: var(--color-white);
  /* --editor-width: 90%; */
}

.relative {
  position: relative;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes dropdownFade {
    from {
      opacity: 0;
      transform: translateY(-0.5rem);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  @keyframes dropdownFade {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.button-primary {
  padding: 0.5rem 1rem;
  background-color: var(--color-button);
  color: var(--color-white);
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: 'Outfit', system-ui, sans-serif;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  min-width: 160px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.button-primary:hover:not(:disabled) {
  background-color: var(--color-button-hover);
  transform: translateY(-1px);
}

.button-primary:disabled {
  background-color: var(--color-disabled);
  cursor: not-allowed;
}

.button-danger {
  padding: 0.5rem 1rem;
  background-color: var(--color-danger);
  color: var(--color-white);
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-family: 'Outfit', system-ui, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .button-danger {
    transition: none;
  }
}

.button-danger:hover {
  background-color: var(--color-danger);
  filter: brightness(90%);
}

.main-content {
  flex: 1;
  padding: var(--page-margins);
  overflow: hidden;
  transition: background-color 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .main-content {
    transition: none;
  }
}

.button-icon {
  padding: 0.5rem;
  background: none;
  border: none;
  border-radius: 0.375rem;
  color: var(--color-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button-icon:hover:not(:disabled) {
  background-color: var(--color-bg);
  color: var(--color-text);
}

.button-icon:disabled {
  color: var(--color-disabled);
  cursor: not-allowed;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.empty-state {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-family: var(--editor-font-family), Georgia, serif;
  font-size: var(--editor-font-size);
}

.empty-state-content {
  text-align: center;
}

.empty-state-text {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.empty-state-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.empty-state-buttons .button-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pin-input-group {
  display: flex;
  gap: 0.5rem;
}

.pin-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.pin-input:focus {
  outline: none;
  border-color: var(--color-text-light);
}

.error-message {
  color: var(--color-danger);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  font-family: 'Outfit', system-ui, sans-serif;
}

.import-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.import-mode-select {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-white);
  font-size: 0.875rem;
  color: var(--color-text);
  min-width: 200px;
  font-family: 'Outfit', system-ui, sans-serif;
}

.import-status {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: 'Outfit', system-ui, sans-serif;
}

.import-status.success {
  background-color: #dcfce7;
  color: #166534;
}

.import-status.error {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Link context menu styles */
.link-context-menu {
  position: fixed;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 1000;
}

.link-context-menu .menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 0.25rem;
  font-family: 'Outfit', system-ui, sans-serif;
}

.link-context-menu .menu-item:hover {
  background-color: var(--color-bg);
}

/* ===== Terminal Theme ===== */
.terminal-theme {
  --color-bg: #f5f0e6;
  --color-white: #faf6ef;
  --color-border: #d4c9b4;
  --color-text: #622c09;
  --color-text-light: #c9560f;
  --color-button: #b84700;
  --color-button-hover: #a63e00;
  --color-danger: #cc3333;
  --color-danger-hover: #ffebeb;
  --color-disabled: #d6ccc0;
  --color-checkbox: #b84700;
  --color-checkbox-bg: #f0e6d6;
}

.terminal-theme,
.terminal-theme .app {
  background-color: #f5f0e6;
}

.terminal-theme .main-content {
  background-color: #faf6ef !important;
}

/* CRT scanline overlay */
.terminal-theme .editor-content::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
  animation: crtScanline 8s linear infinite;
}

@keyframes crtScanline {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* CRT screen flicker */
.terminal-theme .editor-content::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.01);
  opacity: 0;
  pointer-events: none;
  z-index: 9998;
  animation: crtFlicker 0.15s infinite;
}

@keyframes crtFlicker {
  0% { opacity: 0.02; }
  50% { opacity: 0.01; }
  100% { opacity: 0.02; }
}

/* Text glow effect */
.terminal-theme .editor-body .ProseMirror {
  text-shadow: 0 0 2px rgba(184, 71, 0, 0.15);
}

.terminal-theme .editor-title {
  text-shadow: 0 0 4px rgba(184, 71, 0, 0.2);
}

/* Terminal cursor blink */
.terminal-theme .editor-body .ProseMirror .ProseMirror-cursor {
  border-left: 0.5em solid #b84700;
  box-shadow: 0 0 4px rgba(184, 71, 0, 0.4);
}

.terminal-theme .editor-body .ProseMirror p.is-editor-empty:first-child::before {
  color: #b84700;
  opacity: 0.4;
}

/* Terminal-style scrollbar */
.terminal-theme ::-webkit-scrollbar {
  width: 8px;
}

.terminal-theme ::-webkit-scrollbar-track {
  background: #f5f0e6;
}

.terminal-theme ::-webkit-scrollbar-thumb {
  background: #b84700;
  border: 1px solid #f5f0e6;
}

.terminal-theme ::-webkit-scrollbar-thumb:hover {
  background: #a63e00;
}

/* Terminal sidebar adaptation */
.terminal-theme .sidebar {
  background-color: #faf6ef !important;
  border-right: 1px solid #d4c9b4;
}

.terminal-theme .sidebar .note-item:hover,
.terminal-theme .sidebar .notebook-item:hover {
  background-color: rgba(184, 71, 0, 0.06);
}

.terminal-theme .sidebar .note-item.active,
.terminal-theme .sidebar .notebook-item.active {
  background-color: rgba(184, 71, 0, 0.12);
  border-left: 2px solid #b84700;
}

/* Terminal settings modal adaptation */
.terminal-theme .modal {
  background-color: #faf6ef;
  border: 1px solid #d4c9b4;
  box-shadow: 0 0 20px rgba(184, 71, 0, 0.08);
}

.terminal-theme .modal-tab.active {
  background-color: rgba(184, 71, 0, 0.1);
  color: #b84700;
  border-bottom: 2px solid #b84700;
}

.terminal-theme .modal-tab:hover {
  background-color: rgba(184, 71, 0, 0.05);
  color: #a63e00;
}

.terminal-theme select,
.terminal-theme input,
.terminal-theme .setting-item select,
.terminal-theme .setting-item input {
  background-color: #f5f0e6;
  border-color: #d4c9b4;
  color: #b84700;
}

.terminal-theme select:focus,
.terminal-theme input:focus {
  border-color: #b84700;
  outline: none;
  box-shadow: 0 0 4px rgba(184, 71, 0, 0.3);
}

.terminal-theme .button-icon {
  color: #b84700;
}

.terminal-theme .button-icon:hover {
  background-color: rgba(184, 71, 0, 0.08);
  color: #a63e00;
}

.terminal-theme .word-count,
.terminal-theme .language-selector {
  background-color: #faf6ef;
  border: 1px solid #d4c9b4;
  color: #b84700;
}

/* Terminal toast adaptation */
.terminal-theme .toast {
  background-color: #faf6ef;
  border: 1px solid #b84700;
  color: #b84700;
}

/* Terminal links */
.terminal-theme a {
  color: #b84700;
  text-decoration: underline;
}

.terminal-theme a:hover {
  color: #a63e00;
}

/* Terminal task list */
.terminal-theme .editor-body ul[data-type="taskList"] li input[type="checkbox"] {
  border-color: #b84700;
}

.terminal-theme .editor-body ul[data-type="taskList"] li input[type="checkbox"]:checked {
  background-color: #b84700;
  border-color: #b84700;
}

.terminal-theme .editor-body ul[data-type="taskList"] li input[type="checkbox"]:checked + div {
  color: #c9a87c;
  text-decoration: line-through;
}

/* Terminal cut-in */
.terminal-theme .cut-in {
  background: #faf6ef;
  border: 1px solid #d4c9b4;
}

/* Cut-in styles */
.cut-in {
  max-width: 300px;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--color-bg);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: relative;
}

.cut-in.left {
  float: left;
  margin-right: 1.5rem;
  margin-left: -2rem;
}

.cut-in.right {
  float: right;
  margin-left: 1.5rem;
  margin-right: -2rem;
}

.cut-in-image {
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.cut-in-text {
  font-size: 0.875rem;
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
}

/* Sync reminder toast */
.sync-reminder-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 9999;
  animation: slideUp 0.3s ease;
  max-width: 90vw;
  width: auto;
}

.sync-reminder-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
}

.sync-reminder-button {
  padding: 0.5rem 1rem;
  background-color: var(--color-button);
  color: var(--color-white);
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: 'Outfit', system-ui, sans-serif;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.sync-reminder-button:hover {
  background-color: var(--color-button-hover);
}

.sync-reminder-dismiss {
  padding: 0.25rem 0.5rem;
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 0.25rem;
}

.sync-reminder-dismiss:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

@media (max-width: 768px) {
  .sync-reminder-content {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  
  .sync-reminder-button {
    width: 100%;
  }
}

.cut-in-position-toggle {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  color: var(--color-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cut-in:hover .cut-in-position-toggle {
  opacity: 1;
}

.cut-in-position-toggle:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  text-align: center;
  padding: 2rem;
  background: var(--color-white);
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border);
}

.loading-spinner p {
  margin: 0;
  color: var(--color-text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1rem;
}

.editor-body .paragraph-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.5rem 0;
  position: relative;
  z-index: 1;
}

.editor-body .paragraph-tag {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  color: var(--color-text-light);
  white-space: nowrap;
  display: inline-block;
}
