/* ── Swipe File — Library Styles ─────────────────────────── */

body {
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg-deep);
  min-height: 100vh;
}

/* ── Top Bar ───────────────────────────────────────────────── */

.lib-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lib-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.lib-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lib-pro-badge {
  margin-left: 2px;
}

.lib-wordmark {
  font-size: var(--text-xl);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  user-select: none;
}

.lib-topbar-center {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}

.lib-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.lib-search-icon {
  position: absolute;
  left: var(--space-3);
  color: var(--text-tertiary);
  display: flex;
  pointer-events: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.lib-search-input {
  width: 100%;
  padding: var(--space-2) var(--space-4) var(--space-2) 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.lib-search-input::placeholder {
  color: var(--text-tertiary);
}

.lib-search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  background: var(--bg-elevated);
}

.lib-search-input:focus ~ .lib-search-kbd {
  opacity: 0.6;
}

.lib-search-wrap:focus-within .lib-search-icon {
  color: var(--accent-primary);
}

.lib-search-kbd {
  position: absolute;
  right: var(--space-3);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 6px;
  line-height: 1.7;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.lib-topbar-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* ── Toolbar (Filter + View Toggle) ────────────────────────── */

.lib-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.lib-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

.lib-toolbar-left::-webkit-scrollbar { display: none; }

.lib-type-filters {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
}

.lib-type-filters::-webkit-scrollbar { display: none; }

.lib-type-chip {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}

.lib-type-chip:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.lib-type-chip.active {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.lib-type-chip-count {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}

.lib-view-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.lib-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.lib-view-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.lib-view-btn.active {
  color: var(--accent-primary);
  background: var(--accent-subtle);
}

.lib-view-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lib-view-btn--pro {
  overflow: visible;
}

.lib-view-btn-pro {
  position: absolute;
  right: -8px;
  top: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(200, 230, 74, 0.18);
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* ── Filter Dropdowns ──────────────────────────────────────── */

.lib-filter-dropdowns {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.lib-filter-sep {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.lib-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-1) 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.lib-dropdown-trigger:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.lib-dropdown-trigger.is-disabled,
.lib-dropdown-trigger.is-disabled:hover {
  cursor: help;
  color: var(--text-tertiary);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.06);
  opacity: 0.64;
}

.lib-dropdown-trigger.has-value {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border-color: rgba(200, 230, 74, 0.15);
}

.lib-dropdown-pro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 14px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(200, 230, 74, 0.18);
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  vertical-align: middle;
  flex-shrink: 0;
}

.lib-dropdown-trigger.open {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.lib-dropdown-chevron {
  display: flex;
  opacity: 0.5;
  transition: transform var(--duration-fast) var(--ease-out);
}

.lib-dropdown-trigger.open .lib-dropdown-chevron {
  transform: rotate(180deg);
}

/* ── Dropdown Panel (glassmorphism) ───────────────────────── */

.lib-dropdown-panel {
  min-width: 200px;
  max-width: 300px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(255, 255, 255, 0.03);
  padding: var(--space-1);
  animation: dropdownReveal 180ms var(--ease-out);
}

@keyframes dropdownReveal {
  from {
    opacity: 0.6;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lib-dropdown-panel::-webkit-scrollbar {
  width: 4px;
}

.lib-dropdown-panel::-webkit-scrollbar-track {
  background: transparent;
}

.lib-dropdown-panel::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 2px;
}

/* ── Dropdown Items ───────────────────────────────────────── */

.lib-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast) var(--ease-out);
}

.lib-dropdown-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.lib-dropdown-item.selected {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.lib-dropdown-item-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.lib-dropdown-item.selected .lib-dropdown-item-icon {
  color: var(--accent-primary);
}

.lib-dropdown-item-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-dropdown-item-count {
  font-size: 10px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.lib-dropdown-item.selected .lib-dropdown-item-count {
  color: var(--accent-muted);
}

.lib-dropdown-item-check {
  display: flex;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.lib-dropdown-item-checkbox {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
}

.lib-dropdown-item.selected .lib-dropdown-item-checkbox {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #0D0D0F;
}

/* ── Dropdown Search ──────────────────────────────────────── */

.lib-dropdown-search {
  padding: var(--space-1) var(--space-1) 0;
  margin-bottom: var(--space-1);
}

.lib-dropdown-search-input {
  width: 100%;
  padding: 5px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.lib-dropdown-search-input::placeholder {
  color: var(--text-tertiary);
}

.lib-dropdown-search-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* ── Dropdown List (scrollable) ───────────────────────────── */

.lib-dropdown-list {
  max-height: 240px;
  overflow-y: auto;
}

.lib-dropdown-list::-webkit-scrollbar {
  width: 3px;
}

.lib-dropdown-list::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 2px;
}

.lib-dropdown-empty {
  padding: var(--space-4) var(--space-3);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.lib-dropdown-trigger-tooltip {
  position: fixed;
  z-index: 260;
  max-width: 220px;
  padding: 7px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.35;
  pointer-events: none;
}

.lib-dropdown-unavailable {
  max-width: 220px;
  padding: var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.45;
}

/* ── Dropdown Divider & Section Labels ────────────────────── */

.lib-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-1) var(--space-2);
}

.lib-dropdown-section-label {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Date Inputs ──────────────────────────────────────────── */

.lib-dropdown-date-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
}

.lib-dropdown-date-sep {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.lib-dropdown-date-input {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.lib-dropdown-date-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Chrome date picker color scheme */
[data-theme="dark"] .lib-dropdown-date-input::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.5);
}

.lib-dropdown-apply-btn {
  display: block;
  width: calc(100% - var(--space-4));
  margin: var(--space-1) var(--space-2) var(--space-1);
  padding: 5px 0;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  color: #0D0D0F;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.lib-dropdown-apply-btn:hover {
  background: var(--accent-hover);
}

/* ── Active Filter Pills ──────────────────────────────────── */

.lib-active-filters {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-deep);
}

.lib-active-filters[hidden] {
  display: none;
}

.lib-active-filters-list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.lib-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 10px;
  background: var(--accent-subtle);
  border: 1px solid rgba(200, 230, 74, 0.12);
  border-radius: var(--radius-full);
  color: var(--accent-primary);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
  animation: pillIn 200ms var(--ease-out);
}

@keyframes pillIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.lib-filter-pill:hover {
  background: rgba(200, 230, 74, 0.18);
  border-color: rgba(200, 230, 74, 0.25);
}

.lib-filter-pill-label {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-filter-pill-x {
  display: flex;
  opacity: 0.5;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.lib-filter-pill:hover .lib-filter-pill-x {
  opacity: 1;
}

.lib-clear-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.lib-clear-all-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* ── Body Layout ───────────────────────────────────────────── */

.lib-body {
  display: flex;
  min-height: calc(100vh - 96px);
}

/* ── Sidebar ──────────────────────────────────────────────── */

.lib-sidebar {
  width: 240px;
  min-width: 240px;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  transition: width var(--duration-normal) var(--ease-out),
              min-width var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
  position: sticky;
  top: 48px; /* below topbar */
  height: calc(100vh - 48px - 40px);
  will-change: width, opacity;
}

.lib-sidebar::-webkit-scrollbar { width: 3px; }
.lib-sidebar::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 2px;
}

.lib-sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-right: none;
  opacity: 0.6;
  pointer-events: none;
}

.lib-sidebar-inner {
  padding: var(--space-3) 0 var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  height: auto;
  min-height: 100%;
  box-sizing: border-box;
  overflow: visible;
  transition: opacity 160ms var(--ease-out),
              transform 220ms var(--ease-out);
  transform-origin: left center;
}

.lib-sidebar.collapsed .lib-sidebar-inner {
  opacity: 0.6;
  transform: translateX(-10px);
}

/* ── Sidebar Toggle ───────────────────────────────────────── */

.lib-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--space-1) var(--space-3);
  margin-bottom: var(--space-1);
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.lib-sidebar-toggle:hover {
  color: var(--text-primary);
}

/* ── Sidebar Sections ─────────────────────────────────────── */

.lib-sidebar-section {
  padding: 0 var(--space-2);
}

#sidebar-folders {
  min-height: 0;
}

#sidebar-folder-list {
  max-height: clamp(180px, 42vh, 380px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--text-tertiary) transparent;
}

#sidebar-tags {
  min-height: 0;
}

#sidebar-folder-list::-webkit-scrollbar,
.lib-sidebar-tag-cloud::-webkit-scrollbar,
.lib-sidebar::-webkit-scrollbar {
  width: 3px;
}

#sidebar-folder-list::-webkit-scrollbar-thumb,
.lib-sidebar-tag-cloud::-webkit-scrollbar-thumb,
.lib-sidebar::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 2px;
}

.lib-sidebar-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) var(--space-2) var(--space-1);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  user-select: none;
}

.lib-sidebar-section-pro {
  transform: scale(0.82);
  transform-origin: left center;
}

.lib-sidebar-section-label.is-clickable {
  cursor: pointer;
}

.lib-sidebar-section-label.is-clickable:hover {
  color: var(--text-secondary);
}

.lib-sidebar-section-label.is-clickable:focus-visible {
  outline: 1px solid var(--border-focus);
  outline-offset: -1px;
  border-radius: var(--radius-sm);
}

.lib-sidebar-section-action {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  opacity: 0.6;
  transition: all var(--duration-fast) var(--ease-out);
}

.lib-sidebar-section:hover .lib-sidebar-section-action,
.lib-sidebar-section-action:focus-visible {
  opacity: 1;
}

.lib-sidebar-section-action:hover {
  color: var(--accent-primary);
  background: var(--accent-subtle);
}

/* ── Nav Items ────────────────────────────────────────────── */

.lib-sidebar-nav-item,
.lib-sidebar-board-item {
  --sidebar-row-action-space: 46px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 6px var(--space-2);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 450;
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.lib-sidebar-nav-item:hover,
.lib-sidebar-board-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.lib-sidebar-nav-item.active,
.lib-sidebar-board-item.active {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.lib-sidebar-section-label.is-preview-active {
  color: var(--accent-primary);
}

.lib-sidebar-nav-icon {
  display: flex;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.lib-sidebar-nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: padding-right var(--duration-fast) var(--ease-out);
}

.lib-sidebar-nav-count {
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  min-width: 16px;
  text-align: right;
}

.lib-sidebar-board-item .lib-sidebar-nav-count {
  margin-left: auto;
  transition: transform var(--duration-fast) var(--ease-out);
  will-change: transform;
}

.lib-sidebar-nav-item.active .lib-sidebar-nav-count,
.lib-sidebar-board-item.active .lib-sidebar-nav-count {
  color: var(--accent-muted);
}

/* ── Category Items ───────────────────────────────────────── */

.lib-sidebar-cat-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 5px var(--space-2);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast) var(--ease-out);
}

.lib-sidebar-cat-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.lib-sidebar-cat-item.active {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.lib-sidebar-cat-emoji {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.lib-sidebar-cat-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-sidebar-cat-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.lib-sidebar-cat-item.active .lib-sidebar-cat-count {
  color: var(--accent-muted);
}

/* ── Folder Items ─────────────────────────────────────────── */

.lib-sidebar-folder-item {
  --sidebar-row-action-space: 68px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 6px 4px 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.lib-sidebar-folder-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.lib-sidebar-folder-item.active {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

/* Drag handle hidden for cleaner UI (items are naturally draggable anyway) */
.lib-sidebar-folder-grip {
  display: none !important;
}

.lib-sidebar-folder-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.lib-sidebar-folder-item.active .lib-sidebar-folder-icon {
  color: var(--accent-primary);
}

.lib-sidebar-folder-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  transition: padding-right var(--duration-fast) var(--ease-out);
}

.lib-sidebar-folder-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 180px;
  padding: 6px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  pointer-events: none;
  white-space: normal;
}

/* Folder name editing */
.lib-sidebar-folder-label[contenteditable="true"] {
  outline: none;
  background: var(--bg-elevated);
  border-radius: 3px;
  padding: 0 4px;
  margin: 0 -4px;
  box-shadow: 0 0 0 1px var(--border-focus);
  cursor: text;
  overflow: hidden;
  text-overflow: clip;
}

.lib-sidebar-board-label[contenteditable="true"] {
  outline: none;
  background: var(--bg-elevated);
  border-radius: 3px;
  padding: 0 4px;
  margin: 0 -4px;
  box-shadow: 0 0 0 1px var(--border-focus);
  cursor: text;
  overflow: hidden;
  text-overflow: clip;
}

.lib-sidebar-folder-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-left: auto;
  transition: transform var(--duration-fast) var(--ease-out);
  will-change: transform;
}

.lib-sidebar-folder-item.active .lib-sidebar-folder-count {
  color: var(--accent-muted);
}

/* Folder actions (delete) */
.lib-sidebar-folder-actions,
.lib-sidebar-board-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  position: absolute;
  top: 50%;
  right: 10px;
  opacity: 0.6;
  pointer-events: none;
  transform: translateY(-50%) translateX(4px);
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.lib-sidebar-folder-item:hover .lib-sidebar-folder-actions,
.lib-sidebar-folder-item:focus-within .lib-sidebar-folder-actions,
.lib-sidebar-board-item:hover .lib-sidebar-board-actions,
.lib-sidebar-board-item:focus-within .lib-sidebar-board-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.lib-sidebar-folder-item.is-renaming .lib-sidebar-folder-actions,
.lib-sidebar-board-item.is-renaming .lib-sidebar-board-actions,
.lib-sidebar-folder-item.is-renaming:hover .lib-sidebar-folder-actions,
.lib-sidebar-folder-item.is-renaming:focus-within .lib-sidebar-folder-actions,
.lib-sidebar-board-item.is-renaming:hover .lib-sidebar-board-actions,
.lib-sidebar-board-item.is-renaming:focus-within .lib-sidebar-board-actions {
  opacity: 0.6;
  pointer-events: none;
  transform: translateY(-50%) translateX(4px);
}

.lib-sidebar-folder-item:hover .lib-sidebar-folder-count,
.lib-sidebar-folder-item:focus-within .lib-sidebar-folder-count {
  transform: translateX(calc(-1 * var(--sidebar-row-action-space)));
}

.lib-sidebar-board-item:hover .lib-sidebar-nav-count,
.lib-sidebar-board-item:focus-within .lib-sidebar-nav-count {
  transform: translateX(calc(-1 * var(--sidebar-row-action-space)));
}

.lib-sidebar-folder-item.is-renaming .lib-sidebar-folder-count,
.lib-sidebar-board-item.is-renaming .lib-sidebar-nav-count {
  opacity: 0.6;
  pointer-events: none;
  transform: translateX(0);
}

.lib-sidebar-folder-item:hover .lib-sidebar-folder-label:not([contenteditable="true"]),
.lib-sidebar-folder-item:focus-within .lib-sidebar-folder-label:not([contenteditable="true"]),
.lib-sidebar-board-item:hover .lib-sidebar-board-label:not([contenteditable="true"]),
.lib-sidebar-board-item:focus-within .lib-sidebar-board-label:not([contenteditable="true"]) {
  padding-right: var(--sidebar-row-action-space);
}

/* ── Nested Folder Styles ─────────────────────────────────── */

.lib-sidebar-folder-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out), color var(--duration-fast);
}

.lib-sidebar-folder-chevron.empty {
  opacity: 0.6;
  pointer-events: none;
}

.lib-sidebar-folder-chevron:hover {
  color: var(--text-secondary);
}

.lib-sidebar-folder-chevron.expanded {
  transform: rotate(90deg);
}

.lib-sidebar-folder-children {
  display: none;
  flex-direction: column;
}

.lib-sidebar-folder-children.expanded {
  display: flex;
}

.lib-sidebar-folder-item.lib-sidebar-subfolder-item {
  padding-left: 58px;
  position: relative;
}

.lib-sidebar-folder-branch {
  position: absolute;
  left: 43px;
  top: 0;
  bottom: 0;
  width: 12px;
  pointer-events: none;
}

.lib-sidebar-folder-branch::before {
  content: '';
  position: absolute;
  left: 0;
  top: -4px;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}

.lib-sidebar-folder-item.lib-sidebar-subfolder-item.is-last-folder .lib-sidebar-folder-branch::before {
  bottom: 50%;
}

.lib-sidebar-folder-branch::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--border-subtle);
}

.lib-sidebar-new-folder.lib-subfolder-input-wrap {
  padding: 4px 6px 4px 58px;
  gap: 8px !important;
  margin: 0;
}

.lib-subfolder-input-wrap {
  margin-top: 2px;
}

/* New limit tooltip on disable add button */
.lib-sidebar-folder-action-btn.depth-limited {
  color: color-mix(in srgb, var(--text-tertiary) 55%, transparent);
  cursor: not-allowed;
  position: relative;
}

.lib-sidebar-folder-action-btn.depth-limited:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  right: 0;
  transform: translateY(-6px);
  min-width: 132px;
  max-width: 150px;
  padding: 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
  pointer-events: none;
  z-index: 100;
  opacity: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.lib-sidebar-folder-action-btn,
.lib-sidebar-board-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  background: none;
  border: none;
  border-radius: 3px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.lib-sidebar-folder-action-btn:hover,
.lib-sidebar-board-action-btn:hover {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
}

/* Drag-over highlight on folders */
.lib-sidebar-folder-item.dragover {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
  box-shadow: inset 0 0 0 1px var(--accent-primary), 0 0 12px var(--accent-glow);
}

/* Drag-reorder placeholder */
.lib-sidebar-folder-item.drag-source {
  opacity: 0.3;
}

.lib-sidebar-folder-item.drag-above::before {
  content: '';
  position: absolute;
  top: -2px;
  left: var(--space-2);
  right: var(--space-2);
  height: 2px;
  background: var(--accent-primary);
  border-radius: 1px;
}

.lib-sidebar-folder-item.drag-below::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: var(--space-2);
  right: var(--space-2);
  height: 2px;
  background: var(--accent-primary);
  border-radius: 1px;
}

/* ── New Folder Input ─────────────────────────────────────── */

.lib-sidebar-new-folder {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px var(--space-2);
  animation: sidebarFadeIn 200ms var(--ease-out);
}

@keyframes sidebarFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lib-sidebar-new-folder-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--accent-primary);
}

.lib-sidebar-new-folder-field {
  flex: 1;
  min-width: 0;
  padding: 3px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.lib-sidebar-new-folder-field::placeholder {
  color: var(--text-tertiary);
}

/* ── Tag Cloud ────────────────────────────────────────────── */

.lib-sidebar-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  max-height: clamp(88px, 24vh, 180px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--text-tertiary) transparent;
  padding: var(--space-1) var(--space-2);
}

.lib-sidebar-tag {
  display: inline-block;
  padding: 1px 8px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 450;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.6;
  transition: all var(--duration-fast) var(--ease-out);
}

.lib-sidebar-tag:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.lib-sidebar-tag.active {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border-color: rgba(200, 230, 74, 0.2);
}

/* Tag size variations (set by JS based on frequency) */
.lib-sidebar-tag--sm { font-size: 10px; }
.lib-sidebar-tag--md { font-size: 11px; }
.lib-sidebar-tag--lg { font-size: var(--text-xs); }
.lib-sidebar-tag--xl { font-size: var(--text-sm); font-weight: 500; }

/* ── Main Content ──────────────────────────────────────────── */

.lib-main {
  flex: 1;
  min-width: 0;
  padding: var(--space-6);
  padding-bottom: calc(var(--space-6) + 40px); /* account for fixed footer */
  min-height: calc(100vh - 120px);
}

/* ── Masonry Grid ──────────────────────────────────────────── */

.lib-grid {
  position: relative;
  width: 100%;
  transition: height var(--duration-normal) var(--ease-out);
}

/* ── Clip Card ─────────────────────────────────────────────── */

.clip-card {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  /* Only transition transform — box-shadow/border animations caused
     expensive repaints on hover across 40+ cards. */
  transition: transform var(--duration-fast) var(--ease-out);
  opacity: 0.6;
  transform: translateY(16px);
}

.clip-card.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: transform var(--duration-fast) var(--ease-out),
              opacity 500ms var(--ease-out);
}

.clip-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
  border-color: rgba(255, 255, 255, 0.1);
}

.clip-card:hover .clip-actions {
  opacity: 1;
  transform: translateY(0);
}

/* ── Card Media ────────────────────────────────────────────── */

.clip-media {
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
}

.clip-media img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Text card quote area */
.clip-media--text {
  padding: var(--space-5) var(--space-4);
  min-height: 120px;
  display: flex;
  align-items: flex-start;
}

.clip-text-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
}

.clip-text-quote::before {
  content: '\201C';
  color: var(--accent-primary);
  font-size: var(--text-2xl);
  line-height: 0;
  position: relative;
  top: 8px;
  margin-right: 2px;
}

/* Video card overlay */
.clip-media--video {
  position: relative;
}

.clip-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  transition: background var(--duration-fast) var(--ease-out);
}

.clip-card:hover .clip-video-play {
  background: rgba(0, 0, 0, 0.15);
}

.clip-video-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.clip-card:hover .clip-video-play-btn {
  transform: scale(1.1);
  background: var(--accent-primary);
  color: #0D0D0F;
}

.clip-video-timestamp {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

/* URL card centered icon */
.clip-media--url {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
}

.clip-url-favicon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--bg-surface);
  padding: 4px;
}

.clip-url-favicon--placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.clip-url-text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Card Footer ───────────────────────────────────────────── */

.clip-footer {
  padding: var(--space-3) var(--space-3) var(--space-3);
}

.clip-source {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.clip-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

.clip-favicon--placeholder {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.clip-domain {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.clip-type-icon {
  color: var(--text-tertiary);
  display: flex;
  flex-shrink: 0;
}

.clip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.clip-tags:empty {
  display: none;
}

.clip-note {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: var(--space-2);
}

.clip-note:empty {
  display: none;
}

.clip-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ── Card Quick Actions ────────────────────────────────────── */

.clip-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-1) var(--space-3) var(--space-2);
  border-top: 1px solid var(--border-subtle);
  opacity: 0.6;
  transform: translateY(4px);
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.clip-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.clip-action-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ── Always-visible Favorite Badge ─────────────────────────── */

.clip-fav-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(13, 13, 15, 0.55);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0.75;
  transform: scale(1);
  transition:
    opacity var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.clip-card:hover .clip-fav-badge {
  opacity: 1;
}

.clip-fav-badge:hover {
  color: var(--warning);
  background: rgba(13, 13, 15, 0.75);
  transform: scale(1.08);
}

.clip-fav-badge.is-fav {
  color: var(--warning);
  opacity: 1;
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

.clip-fav-badge.is-fav:hover {
  background: rgba(251, 191, 36, 0.22);
  transform: scale(1.08);
}

.clip-action-btn--delete:hover {
  color: var(--danger);
}

/* ── Welcome Landing Page ──────────────────────────────────── */

.welcome-page {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-deep);
  overflow: hidden;
  transition: opacity 400ms ease;
}

/* Subtle dot grid background — feels like a design tool canvas */
.welcome-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(200,230,74,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.welcome-scroll {
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(200,230,74,0.15) transparent;
  position: relative;
  z-index: 1;
}

.welcome-scroll::-webkit-scrollbar { width: 6px; }
.welcome-scroll::-webkit-scrollbar-track { background: transparent; }
.welcome-scroll::-webkit-scrollbar-thumb {
  background: rgba(200,230,74,0.15);
  border-radius: 3px;
}
.welcome-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(200,230,74,0.25);
}

/* ── Hero ──────────────────────────────────────────────────── */

.welcome-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 120px 32px 100px;
  min-height: 92vh;
  justify-content: center;
  overflow: hidden;
}

/* Main glow — large, cinematic, slow-breathing */
.welcome-hero-glow {
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(200,230,74,0.28) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 30%, rgba(200,230,74,0.12) 0%, transparent 60%);
  pointer-events: none;
  animation: welcome-glow-breathe 5s ease-in-out infinite;
  filter: blur(2px);
}

/* Concentric ring — subtle depth */
.welcome-hero-glow-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  width: 560px;
  height: 560px;
  border-radius: 50%;
  border: 1px solid rgba(200,230,74,0.05);
  pointer-events: none;
  box-shadow:
    inset 0 0 80px rgba(200,230,74,0.02),
    0 0 120px rgba(200,230,74,0.015);
}

/* Second ring — smaller, offset */
.welcome-hero-glow-ring::after {
  content: '';
  position: absolute;
  inset: 60px;
  border-radius: 50%;
  border: 1px solid rgba(200,230,74,0.04);
}

@keyframes welcome-glow-breathe {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.85; transform: translateX(-50%) scale(1.04); }
}

.welcome-brand-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(200,230,74,0.14), rgba(200,230,74,0.06));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  margin-bottom: 40px;
  box-shadow:
    0 0 0 1px rgba(200,230,74,0.12),
    0 0 40px var(--accent-glow),
    0 0 100px rgba(200,230,74,0.08);
  position: relative;
  z-index: 1;
  animation: welcome-brand-float 4s ease-in-out infinite;
}

@keyframes welcome-brand-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.welcome-hero-title {
  font-size: clamp(40px, 6.5vw, 64px);
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.welcome-highlight {
  color: var(--accent-primary);
  font-style: italic;
}

.welcome-hero-sub {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.8vw, 18px);
  color: rgba(242, 240, 237, 0.74);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

/* ── CTA Button — the star ─────────────────────────────────── */

.welcome-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  background: var(--accent-primary);
  color: #0D0D0F;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(200,230,74,0.2);
}

.welcome-cta-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 32px rgba(200,230,74,0.3), 0 0 0 1px rgba(200,230,74,0.15);
}

.welcome-cta-btn:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 4px 12px rgba(200,230,74,0.2);
}

.welcome-hero-hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-tertiary);
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
}

/* ── Sections — shared ─────────────────────────────────────── */

.welcome-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 88px 32px;
  text-align: center;
  /* Scroll reveal: starts invisible */
  opacity: 0.6;
  transform: translateY(32px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-section.welcome-revealed {
  opacity: 1;
  transform: translateY(0);
}

.welcome-section-title {
  font-size: clamp(28px, 4.5vw, 42px);
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}

.welcome-section-sub {
  font-family: var(--font-body);
  font-size: 16px;
  color: rgba(242, 240, 237, 0.66);
  margin-bottom: 52px;
  line-height: 1.6;
}

/* ── How It Works Cards ────────────────────────────────────── */

.welcome-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.welcome-feature-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  padding: 36px 28px 32px;
  text-align: left;
  transition: border-color 350ms ease, transform 350ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 350ms ease, background 350ms ease;
  position: relative;
  overflow: hidden;
}

/* Top-edge accent line on hover */
.welcome-feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0.6;
  transition: opacity 350ms ease;
}

.welcome-feature-card:hover {
  border-color: rgba(200,230,74,0.12);
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2), 0 0 24px rgba(200,230,74,0.04);
}

.welcome-feature-card:hover::before {
  opacity: 1;
}

.welcome-feature-step {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  opacity: 0.5;
}

.welcome-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(200,230,74,0.12), rgba(200,230,74,0.04));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  margin-bottom: 22px;
  border: 1px solid rgba(200,230,74,0.08);
}

.welcome-feature-label {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.welcome-feature-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(242, 240, 237, 0.68);
  line-height: 1.65;
}

.welcome-capture-hint {
  margin: 8px 0 0;
  color: rgba(242, 240, 237, 0.74);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
}

.welcome-kbd {
  font-size: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ── Audience Pills ────────────────────────────────────────── */

.welcome-audience-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
}

.welcome-audience-pill {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 11px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}

.welcome-audience-pill:hover {
  border-color: rgba(200,230,74,0.2);
  color: var(--accent-primary);
  background: rgba(200,230,74,0.04);
  transform: translateY(-2px);
}

/* ── Perks Grid ────────────────────────────────────────────── */

.welcome-perks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  text-align: left;
}

.welcome-perk {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: border-color 250ms ease;
}

.welcome-perk:hover {
  border-color: rgba(200,230,74,0.1);
}

.welcome-perk-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(200,230,74,0.12), rgba(200,230,74,0.04));
  color: var(--accent-primary);
  border: 1px solid rgba(200,230,74,0.06);
}

.welcome-perk div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.welcome-perk strong {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.welcome-perk span {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(242, 240, 237, 0.68);
  line-height: 1.45;
}

/* ── Pricing ───────────────────────────────────────────────── */

.welcome-pricing-section {
  max-width: 720px;
}

.welcome-pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  text-align: left;
}

.welcome-pricing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  position: relative;
  transition: border-color 300ms ease, transform 300ms ease;
}

.welcome-pricing-card:hover {
  transform: translateY(-3px);
}

/* Pro card — the star */
.welcome-pricing-pro {
  border-color: rgba(200,230,74,0.16);
  background:
    linear-gradient(175deg, rgba(200,230,74,0.02) 0%, transparent 40%),
    var(--bg-surface);
  box-shadow:
    0 0 26px rgba(200,230,74,0.025),
    0 0 0 1px rgba(200,230,74,0.045) inset;
}

.welcome-pricing-pro:hover {
  border-color: rgba(200,230,74,0.24);
  box-shadow:
    0 0 34px rgba(200,230,74,0.04),
    0 14px 38px rgba(0,0,0,0.14);
}

.welcome-pricing-badge {
  position: absolute;
  top: -13px;
  right: 24px;
  padding: 6px 18px;
  background: var(--accent-primary);
  color: #0D0D0F;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 10px rgba(200,230,74,0.2);
}

.welcome-pricing-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.welcome-pricing-tier {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.welcome-pricing-price {
  font-family: var(--font-display);
  font-size: 44px;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 8px;
}

.welcome-pricing-once {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(242, 240, 237, 0.5);
  font-weight: 400;
}

.welcome-pricing-tagline {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(242, 240, 237, 0.58);
  line-height: 1.4;
}

.welcome-pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.welcome-pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}

.welcome-pricing-features li strong {
  font-weight: 600;
}

.welcome-check,
.welcome-check-pro {
  display: flex;
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.welcome-check-pro {
  color: var(--accent-primary);
  filter: drop-shadow(0 0 2px rgba(200,230,74,0.22));
}

.welcome-cta-pro-btn {
  width: 100%;
  margin-top: 28px;
  justify-content: center;
}

/* ── Final CTA ─────────────────────────────────────────────── */

.welcome-final {
  position: relative;
  padding-bottom: 120px;
  overflow: hidden;
}

.welcome-final-glow {
  position: absolute;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 350px;
  background:
    radial-gradient(ellipse 60% 50%, rgba(200,230,74,0.2) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.4;
  animation: welcome-glow-breathe 5s ease-in-out infinite;
}

.welcome-final-title {
  font-size: clamp(28px, 4.5vw, 42px);
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.welcome-final-sub {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-tertiary);
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
  line-height: 1.6;
}

.welcome-skip-btn {
  display: block;
  margin: 20px auto 0;
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 8px 20px;
  transition: color 200ms ease;
  position: relative;
  z-index: 1;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}

.welcome-skip-btn:hover {
  color: var(--text-secondary);
  border-bottom-color: rgba(255,255,255,0.2);
}

/* ── Entrance Animations ───────────────────────────────────── */

.welcome-page[data-animate] .welcome-brand-circle,
.welcome-page[data-animate] .welcome-hero-title,
.welcome-page[data-animate] .welcome-hero-sub,
.welcome-page[data-animate] .welcome-hero > .welcome-cta-btn,
.welcome-page[data-animate] .welcome-hero-hint {
  animation: welcome-fade-up 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.welcome-page[data-animate] .welcome-brand-circle { animation-delay: 100ms; }
.welcome-page[data-animate] .welcome-hero-title   { animation-delay: 250ms; }
.welcome-page[data-animate] .welcome-hero-sub      { animation-delay: 400ms; }
.welcome-page[data-animate] .welcome-hero > .welcome-cta-btn { animation-delay: 550ms; }
.welcome-page[data-animate] .welcome-hero-hint     { animation-delay: 650ms; }

@keyframes welcome-fade-up {
  from {
    opacity: 0.6;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section children stagger within revealed sections */
.welcome-revealed .welcome-feature-card,
.welcome-revealed .welcome-audience-pill,
.welcome-revealed .welcome-perk,
.welcome-revealed .welcome-pricing-card {
  animation: welcome-card-in 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.welcome-revealed .welcome-feature-card:nth-child(1),
.welcome-revealed .welcome-audience-pill:nth-child(1),
.welcome-revealed .welcome-perk:nth-child(1),
.welcome-revealed .welcome-pricing-card:nth-child(1) { animation-delay: 80ms; }

.welcome-revealed .welcome-feature-card:nth-child(2),
.welcome-revealed .welcome-audience-pill:nth-child(2),
.welcome-revealed .welcome-perk:nth-child(2),
.welcome-revealed .welcome-pricing-card:nth-child(2) { animation-delay: 160ms; }

.welcome-revealed .welcome-feature-card:nth-child(3),
.welcome-revealed .welcome-audience-pill:nth-child(3),
.welcome-revealed .welcome-perk:nth-child(3) { animation-delay: 240ms; }

.welcome-revealed .welcome-audience-pill:nth-child(4),
.welcome-revealed .welcome-perk:nth-child(4) { animation-delay: 320ms; }

.welcome-revealed .welcome-audience-pill:nth-child(5),
.welcome-revealed .welcome-perk:nth-child(5) { animation-delay: 400ms; }

.welcome-revealed .welcome-audience-pill:nth-child(6),
.welcome-revealed .welcome-perk:nth-child(6) { animation-delay: 480ms; }

.welcome-revealed .welcome-audience-pill:nth-child(7) { animation-delay: 560ms; }
.welcome-revealed .welcome-audience-pill:nth-child(8) { animation-delay: 640ms; }

@keyframes welcome-card-in {
  from {
    opacity: 0.6;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 768px) {
  .welcome-hero {
    padding: 72px 20px 56px;
    min-height: auto;
  }
  .welcome-features-grid { grid-template-columns: 1fr; }
  .welcome-perks-grid { grid-template-columns: 1fr; }
  .welcome-pricing-grid { grid-template-columns: 1fr; }
  .welcome-section { padding: 56px 20px; }
  .welcome-hero-glow { width: 400px; height: 300px; }
  .welcome-hero-glow-ring { width: 350px; height: 350px; }
}

/* ── Reduced motion ────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .welcome-page[data-animate] .welcome-brand-circle,
  .welcome-page[data-animate] .welcome-hero-title,
  .welcome-page[data-animate] .welcome-hero-sub,
  .welcome-page[data-animate] .welcome-hero > .welcome-cta-btn,
  .welcome-page[data-animate] .welcome-hero-hint,
  .welcome-revealed .welcome-feature-card,
  .welcome-revealed .welcome-audience-pill,
  .welcome-revealed .welcome-perk,
  .welcome-revealed .welcome-pricing-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .welcome-section {
    opacity: 1;
    transform: none;
  }
  .welcome-hero-glow,
  .welcome-brand-circle {
    animation: none;
  }
}

/* ── Empty State ───────────────────────────────────────────── */

.lib-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: min(500px, calc(100vh - 170px));
  padding: 24px var(--space-6) 32px;
  gap: 0;
}

.lib-empty[hidden] {
  display: none;
}

.lib-empty-art {
  position: relative;
  width: 172px;
  height: 118px;
  margin-bottom: 22px;
}

.lib-empty-card {
  position: absolute;
  width: 104px;
  height: 72px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(23, 24, 21, 0.96), rgba(14, 15, 14, 0.96));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.36);
}

.lib-empty-card--left {
  left: 14px;
  bottom: 4px;
  opacity: 0.62;
  transform: rotate(-8deg);
}

.lib-empty-card--right {
  right: 4px;
  bottom: 16px;
  opacity: 0.64;
  transform: rotate(6deg);
}

.lib-empty-card--front {
  left: 50%;
  top: 8px;
  z-index: 2;
  opacity: 1;
  transform: translateX(-50%);
}

.lib-empty-card-line {
  display: block;
  width: 78px;
  height: 10px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.lib-empty-card-line:first-child {
  margin-top: 0;
}

.lib-empty-card-line--accent {
  height: 10px;
  background: var(--accent-primary);
  box-shadow: 0 0 22px rgba(200, 230, 74, 0.2);
}

.lib-empty-card-line--short {
  width: 56px;
}

.lib-empty-art-ring {
  position: absolute;
  top: -7px;
  right: 0;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(200, 230, 74, 0.36);
  border-radius: 50%;
  background: rgba(200, 230, 74, 0.08);
  box-shadow: 0 0 28px rgba(200, 230, 74, 0.18);
}

.lib-empty-art-ring::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.lib-empty-title {
  font-size: clamp(2rem, 3.5vw, 2.35rem);
  color: var(--text-primary);
  line-height: 1.12;
  max-width: 520px;
  margin-bottom: 16px;
  letter-spacing: 0;
  text-wrap: balance;
}

.lib-empty-accent {
  display: inline-block;
  color: var(--accent-primary);
  font-style: italic;
  font-weight: 400;
  font-size: 0.92em;
  line-height: 1;
  text-shadow: none;
  transform: translateY(0.01em);
}

.lib-empty-sub {
  font-size: var(--text-base);
  color: var(--text-tertiary);
  max-width: 430px;
  line-height: 1.5;
  margin-bottom: 30px;
}

.lib-empty-cta {
  min-height: 44px;
  padding: 0 20px;
  font-size: var(--text-base);
  font-weight: 600;
  gap: var(--space-2);
  color: var(--text-primary);
  background: rgba(13, 13, 15, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

.lib-empty-cta:hover {
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(200, 230, 74, 0.44);
  box-shadow: 0 0 0 1px rgba(200, 230, 74, 0.08), 0 12px 34px rgba(0, 0, 0, 0.28);
}

.lib-empty-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.lib-empty-hint.is-unset > span:not(.lib-empty-shortcut) {
  display: none;
}

.lib-empty-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lib-empty-shortcut.is-shortcut-link {
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.lib-empty-shortcut.is-shortcut-link:hover kbd,
.lib-empty-shortcut.is-shortcut-link:focus-visible kbd {
  color: var(--accent-primary);
  border-color: rgba(200, 230, 74, 0.36);
}

.lib-empty-shortcut.is-unset kbd,
.shortcut-keys.is-unset kbd {
  color: var(--text-secondary);
  border-style: dashed;
}

.lib-empty-shortcut-plus {
  color: rgba(255, 255, 255, 0.22);
}

.lib-empty-hint kbd,
.lib-empty-capture-hint kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
}

.lib-empty-capture-hint {
  margin-top: 16px;
  max-width: 380px;
  color: rgba(255, 255, 255, 0.25);
  font-size: var(--text-xs);
  line-height: 1.45;
}

/* ── Loading State ─────────────────────────────────────────── */

.lib-loading {
  min-height: 40vh;
  padding: 0;
}

.lib-skeleton-grid {
  columns: 4 280px;
  column-gap: 20px;
  padding: 0;
}

.lib-skeleton-card {
  height: var(--h, 220px);
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  break-inside: avoid;
}

.lib-skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: lib-skeleton-shimmer 1.6s linear infinite;
}

@keyframes lib-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .lib-skeleton-card::after { animation: none; }
}

/* ── Footer Stats ──────────────────────────────────────────── */

.lib-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-6);
  background: var(--bg-deep);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  z-index: 50;
}

.lib-footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

/* ── Tag overflow chip ─────────────────────────────────────── */

.tag--overflow {
  background: var(--bg-elevated);
  color: var(--text-tertiary);
}

/* ── Responsive ────────────────────────────────────────────── */

/* ── Sidebar expand toggle (in topbar, visible when collapsed) ── */

.lib-sidebar-expand-btn {
  display: none !important;
}

body.sidebar-collapsed .lib-sidebar-expand-btn {
  display: inline-flex !important;
}

@media (max-width: 768px) {
  .lib-topbar {
    padding: var(--space-3) var(--space-4);
  }

  .lib-wordmark {
    display: none;
  }

  .lib-toolbar {
    padding: 0;
    flex-wrap: wrap;
  }

  .lib-toolbar-left {
    flex-wrap: wrap;
  }

  .lib-filter-dropdowns {
    flex-wrap: wrap;
  }

  .lib-active-filters {
    padding: var(--space-2) var(--space-4);
  }

  .lib-main {
    padding: var(--space-4);
  }

  .lib-content-controls {
    margin: 0 0 var(--space-4);
  }

  .lib-sidebar {
    position: fixed;
    top: 48px;
    left: 0;
    z-index: 90;
    height: calc(100vh - 48px - 40px);
    box-shadow: var(--shadow-elevated);
  }

  .lib-sidebar.collapsed {
    box-shadow: none;
  }
}

@media (max-width: 480px) {
  .lib-topbar-center {
    max-width: none;
  }

  .lib-search-kbd {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   Detail Modal (Phase 4D)
   ══════════════════════════════════════════════════════════════ */

/* ── Backdrop ─────────────────────────────────────────────── */

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10, 10, 12, 0.90);
  /* Removed heavy full-screen blur to fix staggering frame drops */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  opacity: 0.6;
  animation: detail-backdrop-in var(--duration-normal) var(--ease-out) forwards;
}

.detail-backdrop.closing {
  animation: detail-backdrop-out 200ms var(--ease-out) forwards;
}

@keyframes detail-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes detail-backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ── Wrapper (positions modal + nav arrows) ───────────────── */

.detail-wrapper {
  position: relative;
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Modal Container ──────────────────────────────────────── */

.detail-modal {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 64px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated),
              0 0 0 1px rgba(255, 255, 255, 0.04),
              0 32px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0.6;
  transform: scale(0.96) translateY(12px);
  animation: detail-modal-in 400ms cubic-bezier(0.16, 1, 0.3, 1) 50ms forwards;
}

.detail-backdrop.closing .detail-modal {
  animation: detail-modal-out 200ms var(--ease-out) forwards;
}

@keyframes detail-modal-in {
  from {
    opacity: 0.6;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes detail-modal-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0.6;
    transform: scale(0.96) translateY(8px);
  }
}

/* ── Close Button ─────────────────────────────────────────── */

.detail-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 10;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.detail-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
  transform: scale(1.08);
}

/* ── Navigation Arrows ────────────────────────────────────── */

.detail-nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transform: translateY(-50%);
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.detail-nav:hover {
  background: var(--bg-elevated);
  color: var(--accent-primary);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle), 0 2px 12px rgba(0, 0, 0, 0.25);
}

.detail-nav:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.detail-nav--prev {
  left: -52px;
}

.detail-nav--next {
  right: -52px;
}

/* ── Scrollable Body ──────────────────────────────────────── */

.detail-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.detail-body::-webkit-scrollbar {
  width: 4px;
}

.detail-body::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 2px;
}

/* ── Media Section ────────────────────────────────────────── */

.detail-media {
  position: relative;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 480px;
  overflow: hidden;
  cursor: grab;
}

.detail-media:active {
  cursor: grabbing;
}

.detail-media img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  transition: transform 200ms var(--ease-out);
  user-select: none;
  -webkit-user-drag: none;
}

.detail-image-edit-btn {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  background: rgba(13, 13, 15, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(242, 240, 237, 0.86);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  opacity: 0.84;
  transition: opacity var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.detail-image-edit-btn:hover,
.detail-image-edit-btn:focus-visible {
  opacity: 1;
  background: rgba(22, 22, 26, 0.92);
  border-color: rgba(200, 230, 74, 0.28);
  color: var(--accent-primary);
}

.detail-image-edit-btn svg {
  flex-shrink: 0;
}

.detail-media.is-zoomed {
  overflow: auto;
  cursor: grab;
}

.detail-media.is-zoomed img {
  max-width: none;
  max-height: none;
}

.detail-media.is-zoomed:active {
  cursor: grabbing;
}

/* Zoom hint */
.detail-zoom-hint {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-out);
}

/* Image editor */
.image-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.image-editor-modal {
  width: min(1040px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
}

.image-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.lib-content-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) var(--space-5);
  padding: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.lib-scope-row {
  display: flex;
  align-items: flex-start;
  min-width: 0;
}

.lib-scope-label {
  display: inline-flex;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
  font-family: var(--font-body);
}

#content-scope-label {
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: 650;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-editor-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
}

.image-editor-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.image-editor-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.image-editor-stage {
  position: relative;
  flex: 1;
  min-height: 320px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.035) 75%),
    #0b0b0d;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.image-editor-canvas {
  max-width: 100%;
  max-height: min(66vh, 680px);
  object-fit: contain;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.image-editor-crop-box {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 48px;
  min-height: 48px;
  border: 2px solid var(--accent-primary);
  cursor: move;
  box-shadow: 0 0 16px rgba(200, 230, 74, 0.24);
  touch-action: none;
  contain: layout paint;
  will-change: transform, width, height;
}

.image-editor-stage:not([data-active-tool="crop"]) .image-editor-crop-box,
.image-editor-stage:not([data-active-tool="crop"]) .image-editor-crop-mask {
  display: none;
}

.image-editor-crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.image-editor-crop-mask-pane {
  position: absolute;
  background: rgba(0, 0, 0, 0.36);
  pointer-events: none;
}

.image-editor-crop-box::before,
.image-editor-crop-box::after {
  content: '';
  position: absolute;
  inset: 33.333% 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.image-editor-crop-box::after {
  inset: 66.666% 0 auto;
}

.image-editor-crop-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid #0d0d0f;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: nwse-resize;
}

.image-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(13, 13, 15, 0.35);
}

.image-editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font: 600 13px/1 var(--font-body);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.image-editor-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.14);
}

.image-editor-btn.is-active {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border-color: rgba(200, 230, 74, 0.34);
  box-shadow: 0 0 0 1px rgba(200, 230, 74, 0.12) inset;
}

.image-editor-apply {
  margin-left: auto;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #0d0d0f;
}

.image-editor-apply:hover {
  background: var(--accent-hover);
  color: #0d0d0f;
}

/* Text clip display in modal */
.detail-media--text {
  padding: var(--space-8) var(--space-6);
  min-height: 180px;
  max-height: none;
  cursor: default;
  display: block;
}

.detail-text-content {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--text-primary);
  line-height: 1.5;
  max-width: 560px;
  margin: 0 auto;
}

.detail-text-content::before {
  content: '\201C';
  color: var(--accent-primary);
  font-size: 3rem;
  line-height: 0;
  position: relative;
  top: 14px;
  margin-right: 4px;
}

/* Video in modal */
.detail-media--video {
  position: relative;
  cursor: pointer;
}

.detail-media--video .detail-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  transition: background var(--duration-fast) var(--ease-out);
}

.detail-media--video:hover .detail-video-play {
  background: rgba(0, 0, 0, 0.1);
}

.detail-video-play-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all var(--duration-fast) var(--ease-out);
}

.detail-media--video:hover .detail-video-play-circle {
  background: var(--accent-primary);
  color: #0D0D0F;
  transform: scale(1.1);
}

/* URL in modal */
.detail-media--url {
  padding: var(--space-10) var(--space-6);
  flex-direction: column;
  gap: var(--space-3);
  min-height: 160px;
  max-height: none;
  cursor: default;
}

.detail-url-favicon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  background: var(--bg-surface);
  padding: 6px;
}

.detail-url-favicon--placeholder {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--accent-subtle);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Metadata Section ─────────────────────────────────────── */

.detail-meta {
  padding: var(--space-5) var(--space-6);
}

/* Source row */
.detail-source {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.detail-source-favicon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.detail-source-favicon--placeholder {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.detail-source-url {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  transition: color var(--duration-fast) var(--ease-out);
}

.detail-source-url:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.detail-source-visit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  background: none;
  border: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.detail-source-visit:hover {
  color: var(--accent-primary);
  background: var(--accent-subtle);
}

/* Info pills row */
.detail-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.detail-info-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.detail-info-pill svg {
  opacity: 0.6;
}

/* ── Tags ─────────────────────────────────────────────────── */

.detail-tags-section {
  margin-bottom: var(--space-5);
}

.detail-tags-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--accent-subtle);
  border: 1px solid rgba(200, 230, 74, 0.12);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent-primary);
  transition: all var(--duration-fast) var(--ease-out);
}

.detail-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--accent-muted);
  cursor: pointer;
  padding: 0;
  margin-left: -2px;
  opacity: 0.6;
  transition: all var(--duration-fast) var(--ease-out);
}

.detail-tag:hover .detail-tag-remove {
  opacity: 1;
}

.detail-tag-remove:hover {
  background: rgba(200, 230, 74, 0.2);
  color: var(--accent-primary);
}

/* Add tag button */
.detail-tag-add {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  background: transparent;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.detail-tag-add:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-subtle);
}

/* Tag input inline */
.detail-tag-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.detail-tag-input {
  width: 110px;
  padding: 4px 24px 4px 10px;
  background: var(--bg-elevated);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-primary);
  outline: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.detail-tag-input:focus {
  border-style: solid;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.detail-tag-input::placeholder {
  color: var(--text-tertiary);
}


.detail-tag-dropdown-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  pointer-events: none;
}

/* Custom tag autocomplete dropdown */
.detail-tag-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  max-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  list-style: none;
  margin: 0;
  padding: 4px;
  z-index: 100;
  display: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.detail-tag-dropdown.visible {
  display: block;
  animation: tagDropdownIn 120ms var(--ease-out) forwards;
}

@keyframes tagDropdownIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.detail-tag-dropdown-item {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 100ms, color 100ms;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-tag-dropdown-item strong {
  color: var(--accent-primary);
  font-weight: 600;
}

.detail-tag-dropdown-item:hover,
.detail-tag-dropdown-item.highlighted {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.detail-tag-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 6px;
  list-style: none;
}

.detail-tag-dropdown-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: background 100ms, color 100ms;
}

.detail-tag-dropdown-hint strong {
  color: var(--accent-primary);
  font-weight: 600;
}

.detail-tag-dropdown-hint kbd {
  margin-left: auto;
  display: inline-flex;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
}

.detail-tag-dropdown-hint:hover {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.detail-tag-dropdown-hint:hover strong {
  color: var(--accent-primary);
}

.detail-tag-dropdown-hint:hover kbd {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ── Notes ────────────────────────────────────────────────── */

.detail-notes-section {
  margin-bottom: var(--space-5);
}

.detail-notes-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.detail-notes-textarea {
  width: 100%;
  min-height: 72px;
  max-height: 200px;
  padding: var(--space-3);
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.detail-notes-textarea::placeholder {
  color: var(--text-tertiary);
}

.detail-notes-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.detail-notes-saved {
  font-size: 10px;
  color: var(--accent-muted);
  font-family: var(--font-mono);
  margin-top: var(--space-1);
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.detail-notes-saved.visible {
  opacity: 1;
}

.note-dictation-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: -2px;
  margin-bottom: var(--space-1);
}

.note-dictation-row--compare {
  margin-top: 0;
}

.note-dictation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              width var(--duration-fast) var(--ease-out),
              padding var(--duration-fast) var(--ease-out),
              gap var(--duration-fast) var(--ease-out);
}

.note-dictation-btn-label {
  max-width: 0;
  overflow: hidden;
  opacity: 0.6;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transform: translateX(-2px);
  transition: max-width var(--duration-fast) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.note-dictation-btn-label-stop {
  display: none;
}

.note-dictation-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-tertiary);
  background: var(--bg-elevated);
}

.note-dictation-btn:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.note-dictation-btn.is-active {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 3px rgba(200, 230, 74, 0.08), 0 0 0 0 rgba(200, 230, 74, 0.24);
  width: auto;
  padding: 0 10px;
  gap: 6px;
  animation: note-dictation-pulse 1.5s ease-in-out infinite;
}

.note-dictation-btn.is-active .note-dictation-btn-label {
  max-width: 90px;
  opacity: 1;
  transform: translateX(0);
}

.note-dictation-btn.is-active:hover {
  color: #ffb4b4;
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.12);
  animation-name: note-dictation-pulse-stop;
}

.note-dictation-btn.is-active:hover .note-dictation-btn-label-listening {
  display: none;
}

.note-dictation-btn.is-active:hover .note-dictation-btn-label-stop {
  display: inline;
  max-width: 90px;
  opacity: 1;
  transform: translateX(0);
}

@keyframes note-dictation-pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(200, 230, 74, 0.08), 0 0 0 0 rgba(200, 230, 74, 0.22);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(200, 230, 74, 0.12), 0 0 0 8px rgba(200, 230, 74, 0.05);
  }
}

@keyframes note-dictation-pulse-stop {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12), 0 0 0 0 rgba(248, 113, 113, 0.22);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18), 0 0 0 8px rgba(248, 113, 113, 0.06);
  }
}

/* ── Action Bar ───────────────────────────────────────────── */

.detail-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.detail-action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.detail-action-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.detail-action-btn svg {
  flex-shrink: 0;
}

.detail-action-btn--fav {
  margin-left: auto;
}

.detail-action-btn--fav.is-fav {
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.08);
}

.detail-action-btn--fav.is-fav:hover {
  background: rgba(251, 191, 36, 0.12);
}

.detail-action-btn--delete:hover {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.08);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 840px) {
  .detail-nav--prev { left: var(--space-2); }
  .detail-nav--next { right: var(--space-2); }

  .detail-backdrop {
    padding: var(--space-4);
  }

  .detail-wrapper {
    max-width: 100%;
  }

  .detail-modal {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 480px) {
  .detail-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .detail-modal {
    max-height: 92vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .detail-nav { display: none; }

  .detail-meta {
    padding: var(--space-4);
  }

  .detail-actions {
    padding: var(--space-3) var(--space-4);
    flex-wrap: wrap;
  }

  .detail-action-btn--fav {
    margin-left: 0;
  }
}

/* ── Reduced Motion ────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .clip-card {
    opacity: 1;
    transform: none;
  }

  .clip-card.revealed {
    transition: none;
  }

  .detail-backdrop {
    animation: none;
    opacity: 1;
  }

  .detail-modal {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .detail-backdrop.closing,
  .detail-backdrop.closing .detail-modal {
    animation: none;
  }

  .bulk-bar {
    animation: none;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Mock-inspired shell refresh */
body {
  background:
    radial-gradient(circle at top left, rgba(200, 230, 74, 0.045), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.01), transparent 16%),
    var(--bg-deep);
}

.lib-topbar {
  gap: var(--space-4);
  padding: 0 20px;
  min-height: 56px;
  background: rgba(13, 13, 15, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lib-topbar-left {
  gap: 10px;
}

.lib-topbar-center {
  max-width: 440px;
}

.lib-brand-icon {
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.lib-wordmark {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.lib-topbar .btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  color: var(--text-secondary);
  background: transparent;
}

.lib-topbar .btn-icon:hover {
  background: var(--bg-surface);
  border-color: rgba(255, 255, 255, 0.13);
}

.lib-search-input {
  height: 36px;
  padding: 0 40px 0 38px;
  background: rgba(30, 30, 36, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 13px;
}

.lib-search-input:focus {
  background: #26262c;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.lib-search-icon {
  left: 14px;
}

.lib-search-kbd {
  right: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1.5;
  background: #27272d;
  border-color: rgba(255, 255, 255, 0.08);
}

.lib-toolbar {
  gap: 10px;
  padding: 0;
  border-bottom: none;
}

.lib-content-controls {
  gap: 8px;
  margin: -2px -2px 18px;
  padding: 0 0 12px;
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.lib-scope-label {
  font-weight: 600;
}

.lib-toolbar-left {
  gap: 8px;
}

.lib-type-filters {
  gap: 6px;
}

.lib-type-chip,
.lib-dropdown-trigger {
  min-height: 30px;
  padding: 5px 13px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.12);
  font-size: 13.5px;
}

.lib-type-chip:hover,
.lib-dropdown-trigger:hover {
  background: var(--bg-surface);
  border-color: rgba(255, 255, 255, 0.16);
}

.lib-type-chip.active,
.lib-dropdown-trigger.has-value {
  border-color: rgba(200, 230, 74, 0.22);
}

.lib-view-toggle {
  gap: 4px;
}

.lib-view-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
}

.lib-view-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.lib-active-filters {
  gap: 10px;
  padding: 0;
  border-bottom: none;
  background: transparent;
}

.lib-filter-pill {
  min-height: 32px;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  font-size: 13.5px;
  line-height: 1;
}

.lib-filter-pill-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
}

.lib-clear-all-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13.5px;
  font-weight: 500;
}

.lib-body {
  min-height: calc(100vh - 106px);
}

.lib-sidebar {
  width: 224px;
  min-width: 224px;
  top: 56px;
  height: calc(100vh - 56px);
  border-right-color: rgba(255, 255, 255, 0.07);
}

.lib-sidebar-inner {
  padding: 4px 10px 18px;
  gap: 8px;
}

.lib-sidebar-toggle {
  justify-content: flex-start;
  padding: 0 10px 4px;
}

.lib-sidebar-section {
  padding: 0;
}

.lib-sidebar-section-label {
  padding: 12px 10px 5px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
}

.lib-sidebar-section-action {
  opacity: 1;
  padding: 3px;
}

.lib-sidebar-nav-item,
.lib-sidebar-board-item {
  gap: 9px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
}

.lib-sidebar-nav-item:hover,
.lib-sidebar-board-item:hover,
.lib-sidebar-folder-item:hover {
  background: var(--bg-surface);
}

.lib-sidebar-nav-item.active,
.lib-sidebar-board-item.active,
.lib-sidebar-folder-item.active,
.lib-sidebar-section-label.is-preview-active {
  background: rgba(200, 230, 74, 0.11);
}

.lib-sidebar-nav-count,
.lib-sidebar-folder-count {
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 10.5px;
  text-align: center;
}

.lib-sidebar-nav-item.active .lib-sidebar-nav-count,
.lib-sidebar-board-item.active .lib-sidebar-nav-count,
.lib-sidebar-folder-item.active .lib-sidebar-folder-count {
  background: rgba(200, 230, 74, 0.15);
}

.lib-sidebar-folder-item {
  gap: 8px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
}

.lib-sidebar-folder-grip {
  padding: 0;
}

.lib-sidebar-folder-actions,
.lib-sidebar-board-actions {
  gap: 4px;
}

.lib-sidebar-folder-action-btn,
.lib-sidebar-board-action-btn {
  border-radius: 5px;
}

.lib-sidebar-new-folder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 26px;
  border-radius: 7px;
  background: transparent;
}

.lib-sidebar-new-folder-field {
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 13.5px;
  color: rgba(242, 240, 237, 0.76);
  box-shadow: none;
}

.lib-sidebar-new-folder-field::placeholder {
  color: rgba(242, 240, 237, 0.42);
}

.lib-sidebar-new-folder-field:focus {
  border: none;
  box-shadow: none;
  background: transparent;
}

.lib-sidebar-new-folder-icon {
  color: rgba(242, 240, 237, 0.72);
}

.lib-sidebar-tag-cloud {
  gap: 6px;
  padding: 5px 8px 2px;
}

.lib-sidebar-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border-color: transparent;
  font-weight: 500;
}

.lib-sidebar-tag:hover {
  border-color: transparent;
}

.lib-main {
  padding: 20px 22px 72px;
  min-height: calc(100vh - 112px);
}

.clip-card {
  background: #16161a;
  border-color: rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  box-shadow: none;
}

.clip-card:hover {
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.clip-media {
  background: #1f1f24;
}

.clip-media img {
  transition: transform 300ms var(--ease-out);
}

.clip-card:hover .clip-media img {
  transform: scale(1.04);
}

.clip-footer {
  padding: 13px 14px 14px;
}

.clip-source {
  gap: 6px;
  margin-bottom: 8px;
}

.clip-domain {
  font-size: 11px;
  color: var(--text-tertiary);
}

.clip-title {
  margin-bottom: 7px;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.clip-title:hover,
.clip-title:focus {
  background: transparent;
  box-shadow: none;
}

.clip-note-edit {
  width: 100%;
  min-height: 0;
  margin: 0 0 8px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-style: italic;
}

.clip-note-edit:hover,
.clip-note-edit:focus {
  background: transparent;
  border: none;
  box-shadow: none;
}

.clip-tags {
  gap: 6px;
  margin-bottom: 8px;
}

.clip-tags .tag {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
}

.clip-date {
  font-size: 10.5px;
  transition: color var(--duration-fast) var(--ease-out);
}

.clip-actions {
  padding: 0 14px 12px;
  border-top: none;
  border-radius: 0 0 11px 11px;
}

.clip-card:hover .clip-action-btn {
  color: var(--text-secondary);
}

.clip-action-btn {
  border-radius: 7px;
  min-width: 28px;
  min-height: 28px;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.clip-action-btn:hover,
.clip-action-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.clip-action-btn:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.18);
  outline-offset: 2px;
}

.clip-action-btn:active {
  transform: translateY(1px);
}

.clip-card:hover .clip-note-edit::placeholder {
  color: var(--text-secondary);
}

.clip-card:hover .clip-date {
  color: var(--text-secondary);
}

.clip-fav-badge {
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.58);
  border-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0.6;
}

.clip-card:hover .clip-fav-badge,
.clip-fav-badge.is-fav {
  opacity: 1;
}

.clip-card:hover .clip-fav-badge {
  background: rgba(0, 0, 0, 0.72);
  border-color: rgba(255, 255, 255, 0.13);
  color: var(--text-secondary);
}

.clip-fav-badge.is-fav {
  background: rgba(251, 191, 36, 0.16);
}

.lib-list {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(22, 22, 26, 0.55);
}

.list-header {
  padding: 10px 14px;
  background: rgba(13, 13, 15, 0.9);
}

.list-row {
  padding: 10px 14px;
}

.compare-col {
  border-radius: 12px;
}

/* Final onboarding cascade guard */
.welcome-product-body.welcome-demo {
  grid-template-columns: minmax(0, 1fr) 214px !important;
  gap: 0 !important;
  min-height: 420px !important;
}

.welcome-product-body.welcome-demo .welcome-demo-browser,
.welcome-product-body.welcome-demo .welcome-demo-library {
  max-height: 440px;
  overflow: hidden;
}

.welcome-product-body.welcome-demo .welcome-demo-page {
  min-height: 360px;
}

.welcome-product-body.welcome-demo .welcome-shot--large .welcome-shot-media {
  min-height: 140px !important;
}

.welcome-product-body.welcome-demo .welcome-shot-media {
  min-height: 76px !important;
}

.welcome-product-body.welcome-demo .welcome-shot-copy {
  padding: 10px 11px 12px;
}

@media (max-width: 980px) {
  .welcome-product-body.welcome-demo {
    grid-template-columns: 1fr !important;
  }
}

/* Cinematic onboarding refresh */
.first-run-browser {
  position: relative;
  width: min(640px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(30, 30, 36, 0.96), rgba(13, 13, 15, 0.98));
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(200, 230, 74, 0.06) inset;
  opacity: 0.6;
  transform: translateY(24px) scale(0.94);
  animation: first-run-browser-rise 840ms cubic-bezier(0.16, 1, 0.3, 1) 740ms forwards;
}

.first-run-browser-top {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.first-run-browser-top > span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.first-run-browser-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 178px;
  gap: 16px;
  min-height: 310px;
  padding: 18px;
}

.first-run-page {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  padding: 30px;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(13, 13, 15, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #f3efe8, #d9d0c2);
  background-size: 22px 100%, 100% 100%;
  color: #151519;
}

.first-run-page-kicker,
.first-run-page-headline,
.first-run-page-copy,
.first-run-page-cta {
  border-radius: 999px;
  background: rgba(13, 13, 15, 0.72);
}

.first-run-page-kicker {
  width: 34%;
  height: 8px;
  margin-bottom: 18px;
  opacity: 0.34;
}

.first-run-page-headline {
  width: 76%;
  height: 26px;
  margin-bottom: 14px;
}

.first-run-page-copy {
  width: 58%;
  height: 10px;
  opacity: 0.24;
}

.first-run-page-cta {
  width: 118px;
  height: 30px;
  margin-top: 34px;
  background: #c8e64a;
}

.first-run-selection {
  position: absolute;
  left: 24px;
  right: 58px;
  top: 72px;
  height: 126px;
  border: 2px solid #c8e64a;
  border-radius: 12px;
  box-shadow:
    0 0 0 999px rgba(13, 13, 15, 0.18),
    0 0 34px rgba(200, 230, 74, 0.32);
  opacity: 0.6;
  transform: translateY(10px) scale(0.94);
  animation: first-run-selection-lock 920ms cubic-bezier(0.16, 1, 0.3, 1) 1700ms forwards;
}

.first-run-corner {
  position: absolute;
  width: 13px;
  height: 13px;
  border-color: #f2f0ed;
}

.first-run-corner--tl { top: -5px; left: -5px; border-top: 2px solid; border-left: 2px solid; }
.first-run-corner--tr { top: -5px; right: -5px; border-top: 2px solid; border-right: 2px solid; }
.first-run-corner--bl { bottom: -5px; left: -5px; border-bottom: 2px solid; border-left: 2px solid; }
.first-run-corner--br { bottom: -5px; right: -5px; border-bottom: 2px solid; border-right: 2px solid; }

.first-run-save-pulse {
  position: absolute;
  right: 28px;
  bottom: 28px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #0d0d0f;
  color: #c8e64a;
  font: 700 11px/1 var(--font-mono);
  opacity: 0.6;
  transform: translateY(8px) scale(0.94);
  animation: first-run-save-pop 760ms cubic-bezier(0.16, 1, 0.3, 1) 2780ms forwards;
}

.first-run-library-drop {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.first-run-drop-label {
  color: rgba(242, 240, 237, 0.52);
  font-size: 10px;
  text-transform: uppercase;
}

.first-run-library-drop .first-run-card {
  min-height: 68px;
  opacity: 0.6;
  transform: translateX(-18px) scale(0.96);
  animation: first-run-card-drop 640ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.first-run-library-drop .first-run-card--hero {
  min-height: 112px;
  animation-delay: 3360ms;
}

.first-run-library-drop .first-run-card--accent {
  animation-delay: 3680ms;
}

.first-run-library-drop .first-run-card--paper {
  animation-delay: 3920ms;
}

.first-run-status span:nth-child(1) { animation-delay: 1380ms; }
.first-run-status span:nth-child(2) { animation-delay: 2780ms; }
.first-run-status span:nth-child(3) {
  color: rgba(200, 230, 74, 0.9);
  animation-delay: 4200ms;
}

.welcome-demo {
  grid-template-columns: minmax(0, 1fr) 214px;
  gap: 0;
  min-height: 450px;
}

.welcome-demo-browser {
  position: relative;
  padding: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(circle at 28% 22%, rgba(200, 230, 74, 0.12), transparent 34%),
    rgba(255, 255, 255, 0.018);
}

.welcome-demo-page {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  padding: 34px 32px;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(13, 13, 15, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, #f4efe7, #d9cfbf);
  background-size: 24px 100%, 100% 100%;
  color: #111;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.26);
}

.welcome-demo-kicker {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(13, 13, 15, 0.09);
  color: rgba(13, 13, 15, 0.7);
  font: 700 10px/1 var(--font-mono);
  text-transform: uppercase;
}

.welcome-demo-headline {
  max-width: 330px;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: 33px;
  line-height: 1.02;
}

.welcome-demo-copy {
  width: 66%;
  height: 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(13, 13, 15, 0.22);
}

.welcome-demo-copy--short {
  width: 46%;
}

.welcome-demo-cta {
  display: inline-flex;
  margin-top: 30px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #111;
  color: #f4efe7;
  font-weight: 800;
  font-size: 12px;
}

.welcome-demo-selection {
  position: absolute;
  left: 24px;
  right: 46px;
  top: 78px;
  height: 188px;
  border: 2px solid #c8e64a;
  border-radius: 14px;
  box-shadow:
    0 0 0 999px rgba(13, 13, 15, 0.13),
    0 0 34px rgba(200, 230, 74, 0.32);
  transform-origin: center;
  animation: welcome-selection-scan 3600ms cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.welcome-demo-selection span {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #111;
}

.welcome-demo-selection span:nth-child(1) { top: -5px; left: -5px; border-top: 2px solid; border-left: 2px solid; }
.welcome-demo-selection span:nth-child(2) { top: -5px; right: -5px; border-top: 2px solid; border-right: 2px solid; }
.welcome-demo-selection span:nth-child(3) { bottom: -5px; left: -5px; border-bottom: 2px solid; border-left: 2px solid; }
.welcome-demo-selection span:nth-child(4) { bottom: -5px; right: -5px; border-bottom: 2px solid; border-right: 2px solid; }

.welcome-demo-save {
  position: absolute;
  right: 28px;
  bottom: 30px;
  padding: 9px 12px;
  border-radius: 999px;
  background: #111;
  color: #c8e64a;
  font-size: 11px;
  animation: welcome-save-pulse 3600ms ease-out infinite;
}

.welcome-demo-library {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.welcome-demo-card {
  opacity: 0.6;
  transform: translateX(-14px) scale(0.97);
  animation: welcome-demo-card-land 3600ms cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.welcome-demo-card--second {
  animation-delay: 260ms;
}

.welcome-demo-card--third {
  animation-delay: 480ms;
}

@keyframes first-run-browser-rise {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes first-run-selection-lock {
  0% { opacity: 0; transform: translateY(10px) scale(0.94); }
  62% { opacity: 1; transform: translateY(0) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes first-run-save-pop {
  0% { opacity: 0; transform: translateY(8px) scale(0.94); }
  55% { opacity: 1; transform: translateY(0) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes first-run-card-drop {
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes welcome-selection-scan {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.92; }
  45% { transform: translateY(12px) scale(0.98); opacity: 1; }
  72% { transform: translateY(0) scale(1.01); opacity: 1; }
}

@keyframes welcome-save-pulse {
  0%, 42%, 100% { opacity: 0; transform: translateY(8px) scale(0.96); }
  54%, 78% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes welcome-demo-card-land {
  0%, 36% { opacity: 0; transform: translateX(-14px) scale(0.97); }
  52%, 100% { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 980px) {
  .welcome-demo {
    grid-template-columns: 1fr;
  }

  .welcome-demo-browser {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .welcome-demo-library {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .welcome-demo-library .welcome-product-label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .first-run-browser-body {
    grid-template-columns: 1fr;
  }

  .first-run-library-drop {
    display: none;
  }

  .welcome-demo-browser {
    padding: 14px;
  }

  .welcome-demo-page {
    min-height: 320px;
    padding: 26px 22px;
  }

  .welcome-demo-headline {
    font-size: 27px;
  }

  .welcome-demo-selection {
    left: 16px;
    right: 22px;
    top: 74px;
    height: 166px;
  }

  .welcome-demo-library {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .first-run-browser,
  .first-run-selection,
  .first-run-save-pulse,
  .first-run-library-drop .first-run-card,
  .welcome-demo-selection,
  .welcome-demo-save,
  .welcome-demo-card {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* Premium post-install landing refresh */
.welcome-bg-orbs {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.welcome-bg-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.welcome-bg-orbs .orb-1 {
  width: 600px;
  height: 600px;
  background: rgba(200, 230, 74, 0.15);
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.welcome-bg-orbs .orb-2 {
  width: 500px;
  height: 500px;
  background: rgba(100, 150, 255, 0.1);
  top: 40%;
  right: -150px;
  animation-delay: -5s;
}

.welcome-bg-orbs .orb-3 {
  width: 700px;
  height: 700px;
  background: rgba(200, 100, 200, 0.08);
  bottom: -300px;
  left: 30%;
  animation-delay: -10s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -50px) scale(1.1); }
  100% { transform: translate(-30px, 80px) scale(0.95); }
}

.welcome-page {
  background:
    radial-gradient(circle at 18% 18%, rgba(200, 230, 74, 0.12), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(242, 240, 237, 0.06), transparent 24%),
    linear-gradient(180deg, #0d0d0f 0%, #101013 52%, #0d0d0f 100%);
}

.welcome-page::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 78%);
}

.welcome-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 28px;
  background: rgba(13, 13, 15, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.welcome-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 24px;
}

.welcome-brand-icon {
  display: inline-flex;
}

.welcome-nav-link {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-primary);
  cursor: pointer;
  font: 600 13px/1 var(--font-body);
  padding: 10px 16px;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.welcome-nav-link:hover {
  background: var(--accent-subtle);
  border-color: rgba(200, 230, 74, 0.35);
  color: var(--accent-primary);
}

.welcome-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(480px, 1.1fr);
  align-items: center;
  gap: 46px;
  max-width: 1180px;
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 64px 28px 76px;
  text-align: left;
}

.welcome-hero-copy {
  position: relative;
  z-index: 2;
}

.welcome-eyebrow {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--accent-primary);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome-hero-title {
  max-width: 640px;
  margin-bottom: 22px;
  font-size: clamp(42px, 5.4vw, 72px);
  line-height: 1.04;
  letter-spacing: 0;
}

.welcome-highlight {
  color: var(--accent-primary);
  font-style: italic;
}

.welcome-hero-sub {
  max-width: 560px;
  margin: 0 0 34px;
  color: rgba(242, 240, 237, 0.76);
  font-size: 18px;
  line-height: 1.7;
}

.welcome-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.welcome-cta-btn {
  min-height: 50px;
  border-radius: var(--radius-md);
  padding: 14px 22px;
  font-size: 15px;
  box-shadow: 0 14px 38px rgba(200, 230, 74, 0.18);
}

.welcome-cta-btn--secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.welcome-cta-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--accent-primary);
  border-color: rgba(200, 230, 74, 0.24);
  box-shadow: none;
}

.welcome-hero-hint {
  margin-top: 16px;
  color: rgba(242, 240, 237, 0.5);
}

.welcome-product {
  position: relative;
  z-index: 1;
}

.welcome-product::before {
  content: '';
  position: absolute;
  inset: 12% -6% -8% 8%;
  background: radial-gradient(circle, rgba(200, 230, 74, 0.16), transparent 66%);
  filter: blur(14px);
}

.welcome-product-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(30, 30, 36, 0.94), rgba(13, 13, 15, 0.96));
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(200, 230, 74, 0.05) inset;
}

.welcome-product-topbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.welcome-product-topbar > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.welcome-product-search {
  flex: 1;
  margin-left: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.035);
  color: #85858a;
  font: 12px/1 var(--font-mono);
}

.welcome-product-body {
  display: grid;
  grid-template-columns: 154px 1fr;
  min-height: 430px;
}

.welcome-product-sidebar {
  padding: 18px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
}

.welcome-product-label {
  margin: 0 8px 12px;
  color: var(--text-tertiary);
  font: 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome-product-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
}

.welcome-product-nav.is-active {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.welcome-product-grid {
  display: grid;
  grid-template-columns: 1fr 0.78fr;
  gap: 14px;
  padding: 18px;
}

.welcome-shot {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: #151519;
}

.welcome-shot--large {
  grid-row: span 2;
}

.welcome-shot-media {
  min-height: 154px;
  background:
    linear-gradient(135deg, rgba(200, 230, 74, 0.22), transparent 38%),
    linear-gradient(180deg, #f2f0ed 0%, #d9d4ca 100%);
}

.welcome-shot--large .welcome-shot-media {
  min-height: 286px;
}

.welcome-shot-media--green {
  background:
    radial-gradient(circle at 72% 28%, rgba(13, 13, 15, 0.36), transparent 24%),
    linear-gradient(135deg, #c8e64a, #596713);
}

.welcome-shot-media--paper {
  background:
    linear-gradient(90deg, rgba(13, 13, 15, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, #eee7dc, #b9aa97);
  background-size: 18px 100%, 100% 100%;
}

.welcome-shot-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 14px 15px;
}

.welcome-shot-copy span {
  color: var(--text-tertiary);
  font: 11px/1 var(--font-mono);
}

.welcome-shot-copy strong {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.35;
}

.welcome-workflow {
  padding-top: 80px;
}

.welcome-section {
  max-width: 1040px;
}

.welcome-feature-card,
.welcome-pricing-card {
  border-radius: var(--radius-lg);
}

.welcome-pricing-section {
  max-width: 820px;
}

.welcome-final {
  max-width: 760px;
}

.welcome-page[data-animate] .welcome-wordmark,
.welcome-page[data-animate] .welcome-nav-link,
.welcome-page[data-animate] .welcome-eyebrow,
.welcome-page[data-animate] .welcome-hero-title,
.welcome-page[data-animate] .welcome-hero-sub,
.welcome-page[data-animate] .welcome-hero-actions,
.welcome-page[data-animate] .welcome-hero-hint,
.welcome-page[data-animate] .welcome-product-frame {
  animation: welcome-fade-up 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.welcome-page[data-animate] .welcome-eyebrow { animation-delay: 80ms; }
.welcome-page[data-animate] .welcome-hero-title { animation-delay: 160ms; }
.welcome-page[data-animate] .welcome-hero-sub { animation-delay: 240ms; }
.welcome-page[data-animate] .welcome-hero-actions { animation-delay: 320ms; }
.welcome-page[data-animate] .welcome-hero-hint { animation-delay: 400ms; }
.welcome-page[data-animate] .welcome-product-frame { animation-delay: 220ms; }

@media (max-width: 980px) {
  .welcome-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 48px;
  }

  .welcome-product-frame {
    max-width: 680px;
  }
}

@media (max-width: 640px) {
  .welcome-nav {
    padding: 14px 16px;
  }

  .welcome-wordmark {
    font-size: 20px;
  }

  .welcome-nav-link {
    padding: 9px 12px;
  }

  .welcome-hero {
    padding: 42px 18px 58px;
  }

  .welcome-hero-title {
    font-size: 44px;
  }

  .welcome-hero-sub {
    font-size: 15px;
  }

  .welcome-hero-actions,
  .welcome-cta-btn {
    width: 100%;
  }

  .welcome-cta-btn {
    justify-content: center;
  }

  .welcome-product-body {
    grid-template-columns: 1fr;
  }

  .welcome-product-sidebar {
    display: none;
  }

  .welcome-product-grid {
    grid-template-columns: 1fr;
  }

  .welcome-shot--large {
    grid-row: auto;
  }

  .welcome-shot--large .welcome-shot-media,
  .welcome-shot-media {
    min-height: 150px;
  }
}

.first-run-reveal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(200, 230, 74, 0.18), transparent 30%),
    linear-gradient(180deg, #0d0d0f 0%, #131317 48%, #0d0d0f 100%);
  color: var(--text-primary);
  opacity: 1;
  transform: translateY(0);
}

.first-run-reveal[hidden] {
  display: none;
}

.first-run-reveal::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.42;
  transform: translateY(0);
  animation: first-run-grid-drift 5500ms ease-out both;
}

.first-run-reveal.is-exiting {
  pointer-events: none;
  animation: first-run-exit 620ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.first-run-skip {
  position: absolute;
  top: 22px;
  right: 24px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(242, 240, 237, 0.72);
  cursor: pointer;
  font: 600 12px/1 var(--font-body);
  opacity: 0.6;
  padding: 9px 13px;
  transform: translateY(-4px);
  animation: first-run-skip-in 420ms var(--ease-out) 500ms forwards;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.first-run-skip:hover {
  background: var(--accent-subtle);
  border-color: rgba(200, 230, 74, 0.3);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.first-run-stage {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(680px, calc(100vw - 40px));
  transform-origin: center 52%;
  animation: first-run-stage-snap 560ms cubic-bezier(0.16, 1, 0.3, 1) 4880ms both;
}

.first-run-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
  color: var(--text-primary);
  opacity: 0.6;
  transform: translateY(12px) scale(0.96);
  animation: first-run-logo-pulse 1300ms cubic-bezier(0.16, 1, 0.3, 1) 160ms forwards;
}

.first-run-logo-mark {
  display: inline-flex;
}

.first-run-logo-text {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.first-run-device {
  position: relative;
  width: min(520px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(30, 30, 36, 0.96), rgba(13, 13, 15, 0.98));
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(200, 230, 74, 0.05) inset;
  opacity: 0.6;
  transform: translateY(24px) scale(0.94);
  animation: first-run-device-rise 980ms cubic-bezier(0.16, 1, 0.3, 1) 900ms forwards;
}

.first-run-device-top {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.first-run-device-top > span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.first-run-search {
  flex: 1;
  height: 26px;
  margin-left: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  background:
    linear-gradient(90deg, rgba(133, 133, 138, 0.22) 0 36%, transparent 36%),
    rgba(255, 255, 255, 0.035);
}

.first-run-device-body {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 16px;
  min-height: 256px;
  padding: 18px;
}

.first-run-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

.first-run-rail span {
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.055);
  opacity: 0.6;
  transform: translateX(-10px);
  animation: first-run-line-in 500ms ease-out forwards;
}

.first-run-rail span:nth-child(1) {
  background: var(--accent-subtle);
  animation-delay: 1780ms;
}

.first-run-rail span:nth-child(2) {
  width: 84%;
  animation-delay: 1940ms;
}

.first-run-rail span:nth-child(3) {
  width: 70%;
  animation-delay: 2100ms;
}

.first-run-cards {
  display: grid;
  grid-template-columns: 1fr 0.78fr;
  gap: 13px;
}

.first-run-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 108px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(200, 230, 74, 0.18), transparent 42%),
    #16161a;
  opacity: 0.6;
  transform: translateY(18px);
  animation: first-run-card-in 620ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.first-run-card--hero {
  grid-row: span 2;
  min-height: 232px;
  background:
    linear-gradient(135deg, rgba(200, 230, 74, 0.24), transparent 36%),
    linear-gradient(180deg, #f2f0ed 0 56%, #17171b 56%);
  animation-delay: 2340ms;
}

.first-run-card--accent {
  background:
    radial-gradient(circle at 72% 30%, rgba(13, 13, 15, 0.34), transparent 26%),
    linear-gradient(135deg, #c8e64a, #596713);
  animation-delay: 2660ms;
}

.first-run-card--paper {
  background:
    linear-gradient(90deg, rgba(13, 13, 15, 0.13) 1px, transparent 1px),
    linear-gradient(180deg, #eee7dc 0 62%, #17171b 62%);
  background-size: 18px 100%, 100% 100%;
  animation-delay: 2960ms;
}

.first-run-card span,
.first-run-card strong {
  display: block;
  border-radius: var(--radius-full);
  background: rgba(242, 240, 237, 0.72);
}

.first-run-card span {
  width: 42%;
  height: 7px;
  margin-bottom: 8px;
  opacity: 0.54;
}

.first-run-card strong {
  width: 74%;
  height: 10px;
}

.first-run-sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, 0.16) 48%, transparent 62%);
  opacity: 0.6;
  transform: translateX(-75%);
  animation: first-run-light-sweep 1180ms ease-out 3600ms forwards;
  pointer-events: none;
}

.first-run-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.055);
}

.first-run-progress::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, rgba(200, 230, 74, 0.4), var(--accent-primary), rgba(242, 240, 237, 0.7));
  transform: scaleX(0);
  transform-origin: left center;
  animation: first-run-progress-fill 4800ms cubic-bezier(0.16, 1, 0.3, 1) 520ms forwards;
}

.first-run-status {
  position: relative;
  width: min(520px, 100%);
  min-height: 20px;
  margin-top: 16px;
  color: rgba(242, 240, 237, 0.58);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.first-run-status span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.6;
  transform: translateY(6px);
  animation: first-run-status-step 1300ms ease-out both;
}

.first-run-status span:nth-child(1) {
  animation-delay: 1600ms;
}

.first-run-status span:nth-child(2) {
  animation-delay: 3000ms;
}

.first-run-status span:nth-child(3) {
  color: rgba(200, 230, 74, 0.9);
  animation-delay: 4300ms;
}

.first-run-line {
  margin-top: 14px;
  color: rgba(242, 240, 237, 0.9);
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.15;
  text-align: center;
  opacity: 0.6;
  transform: translateY(12px);
  animation: first-run-line-rise 820ms cubic-bezier(0.16, 1, 0.3, 1) 4040ms forwards;
}

.welcome-intro-active .welcome-scroll {
  opacity: 0.18;
  transform: translateY(14px) scale(0.985);
  pointer-events: none;
}

.welcome-scroll {
  transition:
    opacity 620ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-scroll-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes first-run-logo-pulse {
  0% { opacity: 0; transform: translateY(12px) scale(0.96); }
  58% { opacity: 1; transform: translateY(0) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes first-run-skip-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes first-run-device-rise {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes first-run-line-in {
  to { opacity: 1; transform: translateX(0); }
}

@keyframes first-run-card-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes first-run-light-sweep {
  0% { opacity: 0; transform: translateX(-75%); }
  24% { opacity: 1; }
  100% { opacity: 0; transform: translateX(75%); }
}

@keyframes first-run-progress-fill {
  0% { transform: scaleX(0); }
  64% { transform: scaleX(0.72); }
  100% { transform: scaleX(1); }
}

@keyframes first-run-status-step {
  0% { opacity: 0; transform: translateY(6px); }
  18%, 72% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-5px); }
}

@keyframes first-run-line-rise {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes first-run-stage-snap {
  0%, 55% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(0.985); }
}

@keyframes first-run-grid-drift {
  to { transform: translateY(-16px); }
}

@keyframes first-run-exit {
  to { opacity: 0; transform: translateY(-10px); }
}

@media (max-width: 640px) {
  .first-run-device-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .first-run-rail {
    display: none;
  }

  .first-run-cards {
    grid-template-columns: 1fr;
  }

  .first-run-card--hero {
    grid-row: auto;
    min-height: 150px;
  }

  .first-run-skip {
    top: 14px;
    right: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .first-run-reveal,
  .first-run-reveal::before,
  .first-run-logo-wrap,
  .first-run-device,
  .first-run-rail span,
  .first-run-card,
  .first-run-sweep,
  .first-run-progress::before,
  .first-run-status span,
  .first-run-line,
  .welcome-scroll {
    animation: none !important;
    transition: none !important;
    opacity: 1;
    transform: none;
  }
}

.lib-empty-title {
  max-width: 520px;
}

.lib-empty-sub {
  max-width: 440px;
}

.lib-loading {
  padding-top: 8px;
}

.lib-footer {
  justify-content: flex-start;
  padding: 10px 22px;
  background: rgba(13, 13, 15, 0.92);
  border-top-color: rgba(255, 255, 255, 0.07);
}

@media (max-width: 768px) {
  .lib-topbar {
    padding: 0 14px;
  }

  .lib-toolbar {
    padding: 0;
  }

  .lib-active-filters {
    padding: 8px 14px;
  }

  .lib-sidebar {
    top: 56px;
    height: calc(100vh - 56px - 40px);
  }

  .lib-main {
    padding: 16px 14px 72px;
  }

  .lib-content-controls {
    margin: 0 0 16px;
    padding-bottom: 12px;
  }

  .lib-footer {
    padding: 10px 14px;
  }
}

/* ── Phase 4E: Inline Editing & Selection ─────────────────── */

/* ── Editable Title ───────────────────────────────────────── */

.clip-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: var(--space-1);
  padding: 2px 4px;
  margin-left: -4px;
  margin-right: -4px;
  border-radius: var(--radius-sm);
  outline: none;
  border: 1px solid transparent;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  cursor: text;
}

.clip-title:hover {
  background: var(--accent-subtle);
}

.clip-title:focus {
  -webkit-line-clamp: unset;
  border-color: var(--border-focus);
  background: rgba(200, 230, 74, 0.06);
  box-shadow: 0 0 0 2px rgba(200, 230, 74, 0.08);
}

.clip-title:empty::before {
  content: 'Add title...';
  color: var(--text-tertiary);
  font-style: italic;
  font-weight: 400;
}

/* ── Editable Notes ───────────────────────────────────────── */

.clip-note-edit {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-left: -4px;
  margin-right: -4px;
  margin-bottom: var(--space-1);
  width: calc(100% + 8px);
  min-height: 20px;
  max-height: 80px;
  resize: none;
  outline: none;
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
  field-sizing: content;
}

.clip-note-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.clip-note-row .clip-note-edit {
  flex: 1;
  margin-bottom: 0;
}

.clip-note-row .note-dictation-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-bottom: 2px;
}

.clip-note-edit::placeholder {
  color: var(--text-tertiary);
  font-style: italic;
}

.clip-note-edit:hover {
  background: var(--accent-subtle);
}

.clip-note-edit:focus {
  border-color: var(--border-focus);
  background: rgba(200, 230, 74, 0.06);
  box-shadow: 0 0 0 2px rgba(200, 230, 74, 0.08);
  color: var(--text-primary);
  max-height: 200px;
  overflow-y: auto;
}

/* Save indicator on card */
.clip-save-indicator {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent-primary);
  opacity: 0.6;
  transform: translateY(2px);
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
  pointer-events: none;
  text-align: right;
  margin-top: -2px;
  margin-bottom: var(--space-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.clip-save-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Multi-Select Mode ────────────────────────────────────── */

.clip-card.is-selected {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 2px var(--accent-glow),
              0 0 24px rgba(200, 230, 74, 0.12);
}

.clip-card.is-selected .clip-select-check {
  opacity: 1;
  transform: scale(1);
}

.clip-select-check {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #0D0D0F;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0.6;
  transform: scale(0.5);
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Show unchecked circle on hover when in select mode */
body.select-mode .clip-card:not(.is-selected) .clip-select-check {
  opacity: 0.4;
  transform: scale(1);
  background: var(--bg-elevated);
  border: 2px solid var(--text-tertiary);
  color: transparent;
}

body.select-mode .clip-card:not(.is-selected):hover .clip-select-check {
  opacity: 0.7;
  border-color: var(--accent-primary);
}

body.select-mode .clip-card {
  cursor: pointer;
}

/* ── Bulk Actions Bar ─────────────────────────────────────── */

.bulk-bar {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: rgba(30, 30, 36, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(200, 230, 74, 0.15);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.04) inset,
              0 0 60px rgba(200, 230, 74, 0.06);
  z-index: 1000;
  opacity: 0.6;
  animation: bulk-bar-enter 350ms var(--ease-out) forwards;
}

@keyframes bulk-bar-enter {
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.bulk-bar.closing {
  animation: bulk-bar-exit 200ms var(--ease-out) forwards;
}

@keyframes bulk-bar-exit {
  to {
    opacity: 0.6;
    transform: translateX(-50%) translateY(16px);
  }
}

.bulk-count {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-primary);
  font-weight: 600;
  white-space: nowrap;
  padding-right: var(--space-2);
  border-right: 1px solid var(--border-subtle);
}

.bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}

.bulk-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.bulk-btn--danger:hover {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.2);
}

.bulk-btn--accent {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border-color: rgba(200, 230, 74, 0.15);
}

.bulk-btn--accent:hover {
  background: rgba(200, 230, 74, 0.18);
  color: var(--accent-hover);
  border-color: rgba(200, 230, 74, 0.3);
}

.bulk-btn--deselect {
  color: var(--text-tertiary);
  padding: var(--space-2);
}

.bulk-btn--deselect:hover {
  color: var(--text-primary);
}

/* Pro feature previews */
.pro-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
  background: linear-gradient(135deg, rgba(200, 230, 74, 0.12), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(200, 230, 74, 0.24);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.pro-preview-banner-copy {
  min-width: 0;
}

.pro-preview-badge,
.board-preview-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0;
}

.sample-data-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(200, 230, 74, 0.28);
  color: rgba(242, 240, 237, 0.64);
}

.pro-preview-banner h2 {
  margin: var(--space-2) 0 var(--space-1);
  font-size: var(--text-xl);
  color: var(--text-primary);
  line-height: 1.2;
}

.pro-preview-banner p {
  max-width: 640px;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.pro-preview-unlock {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Phase 4F: List View ──────────────────────────────────── */

.lib-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* List header row */
.list-header {
  display: grid;
  grid-template-columns: 40px 56px 1fr 100px 140px 100px 80px;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-deep);
  z-index: 5;
}

.list-header-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}

.list-header-cell--sortable {
  cursor: pointer;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.list-header-cell--sortable:hover {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}

.list-header-cell--sortable.sort-active {
  color: var(--accent-primary);
}

.lib-list--preview .list-header-cell--sortable,
.list-header--preview .list-header-cell {
  cursor: default;
}

.list-header-sort-icon {
  display: inline-flex;
  transition: transform var(--duration-fast) var(--ease-out);
}

.list-header-sort-icon.sort-asc {
  transform: rotate(180deg);
}

/* List row */
.list-row {
  display: grid;
  grid-template-columns: 40px 56px 1fr 100px 140px 100px 80px;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
  opacity: 0.6;
  transform: translateY(6px);
  position: relative;
}

.list-row.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              opacity 400ms var(--ease-out),
              transform 400ms var(--ease-out);
}

.list-row:hover {
  background: var(--bg-surface);
}

.list-row:last-child {
  border-bottom: none;
}

/* List row select checkbox */
.list-row-check {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.5px solid var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
  cursor: pointer;
  color: transparent;
}

.list-row:hover .list-row-check,
body.select-mode .list-row-check {
  opacity: 0.6;
}

.list-row.is-selected .list-row-check {
  opacity: 1;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #0D0D0F;
}

.list-row.is-selected {
  background: var(--accent-subtle);
  border-color: rgba(200, 230, 74, 0.08);
}

.list-row--preview {
  cursor: default;
}

.list-row--preview:hover {
  background: rgba(255, 255, 255, 0.025);
}

.list-row-check--locked {
  opacity: 1;
  color: var(--text-tertiary);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

/* List thumbnail */
.list-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  flex-shrink: 0;
  position: relative;
}

.list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.list-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.list-thumb--text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 10px;
  color: var(--text-secondary);
  padding: 6px;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* List title cell */
.list-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.list-title--empty {
  color: var(--text-tertiary);
  font-style: italic;
}

/* List type cell */
.list-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

.list-type-icon {
  display: inline-flex;
  color: var(--text-tertiary);
}

/* List source cell */
.list-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.list-source-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.list-source-domain {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* List date cell */
.list-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* List row actions (on hover) */
.list-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.list-row:hover .list-actions {
  opacity: 1;
}

.list-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.list-action-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.list-action-btn--fav.is-fav {
  color: var(--warning);
}

.list-action-btn--delete:hover {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
}

.list-preview-lock {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0;
}

/* List thumbnail preview tooltip */
.list-thumb-preview {
  position: fixed;
  z-index: 200;
  width: 280px;
  max-height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6),
              0 0 0 1px var(--border-subtle);
  pointer-events: none;
  opacity: 0.6;
  transform: scale(0.92);
  transition: opacity 200ms var(--ease-out),
              transform 200ms var(--ease-out);
}

.list-thumb-preview.visible {
  opacity: 1;
  transform: scale(1);
}

.list-thumb-preview img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 200px;
  object-fit: contain;
  background: var(--bg-surface);
}

/* Empty check column in header */
.list-header-check {
  width: 20px;
}

/* ── Phase 4F: Compare View ───────────────────────────────── */

.lib-compare {
  width: 100%;
  min-height: calc(100vh - 200px);
}

/* Compare empty/prompt state */
.compare-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  min-height: 400px;
}

.compare-prompt-icon {
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.compare-prompt-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.compare-prompt-sub {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  max-width: 360px;
  line-height: 1.5;
}

.compare-prompt-hint {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-4);
  opacity: 0.7;
}

.compare-prompt-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
}

/* Compare columns layout */
.compare-columns {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-2) 0;
}

.compare-columns--2 {
  grid-template-columns: 1fr 1fr;
}

.compare-columns--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Compare overflow note */
.compare-overflow {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  padding: var(--space-3) 0 var(--space-2);
  font-family: var(--font-mono);
}

/* Compare column (single card) */
.compare-col {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0.6;
  transform: translateY(12px);
  animation: compare-col-enter 500ms var(--ease-out) forwards;
}

.compare-col:nth-child(1) { animation-delay: 0ms; }
.compare-col:nth-child(2) { animation-delay: 80ms; }
.compare-col:nth-child(3) { animation-delay: 160ms; }

@keyframes compare-col-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Compare column header (remove btn) */
.compare-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 40px;
}

.compare-col-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compare-col-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.compare-col-remove:hover {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
}

/* Compare media area */
.compare-media {
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
  max-height: 400px;
}

.compare-media img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 400px;
  background: var(--bg-elevated);
}

.compare-media--text {
  padding: var(--space-5) var(--space-4);
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
}

.compare-text-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-primary);
  line-height: 1.5;
}

.compare-text-quote::before {
  content: '\201C';
  color: var(--accent-primary);
  font-size: var(--text-2xl);
  line-height: 0;
  position: relative;
  top: 8px;
  margin-right: 2px;
}

.compare-media--url {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
}

.compare-media--video {
  position: relative;
}

.compare-media--video .clip-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

.compare-media--video .clip-video-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* Compare detail section */
.compare-detail {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.compare-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.compare-source {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.compare-source-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.compare-source a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.compare-source a:hover {
  color: var(--accent-primary);
}

/* Compare tags */
.compare-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.compare-tags .tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-primary);
  background: var(--accent-subtle);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Compare notes */
.compare-notes {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  margin: 0;
  width: 100%;
  min-height: 60px;
  max-height: 140px;
  resize: none;
  outline: none;
  overflow: hidden;
  field-sizing: content;
  transition: border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.compare-notes::placeholder {
  color: var(--text-tertiary);
  font-style: italic;
}

.compare-notes:hover {
  background: var(--accent-subtle);
}

.compare-notes:focus {
  border-color: var(--border-focus);
  background: rgba(200, 230, 74, 0.06);
  box-shadow: 0 0 0 2px rgba(200, 230, 74, 0.08);
  color: var(--text-primary);
  max-height: 200px;
  overflow-y: auto;
}

.compare-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.compare-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.compare-saved {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent-primary);
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-out);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compare-saved.visible {
  opacity: 1;
}

/* ── Phase 4F: Reduced Motion ─────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .list-row {
    opacity: 1;
    transform: none;
  }

  .list-row.revealed {
    transition: background var(--duration-fast) var(--ease-out);
  }

  .compare-col {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .list-thumb-preview {
    transition: none;
  }
}

/* ── Phase 4G: Shortcuts Overlay ─────────────────────────── */

.shortcuts-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: shortcutsBackdropIn 300ms var(--ease-out) both;
}

.shortcuts-backdrop.closing {
  animation: shortcutsBackdropOut 250ms var(--ease-out) both;
}

@keyframes shortcutsBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shortcutsBackdropOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.shortcuts-panel {
  position: relative;
  width: min(640px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 80px rgba(0, 0, 0, 0.5),
    0 0 120px rgba(200, 230, 74, 0.04);
  animation: shortcutsPanelIn 400ms var(--ease-out) both;
  animation-delay: 60ms;
}

.shortcuts-backdrop.closing .shortcuts-panel {
  animation: shortcutsPanelOut 200ms var(--ease-out) both;
}

@keyframes shortcutsPanelIn {
  from {
    opacity: 0.6;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes shortcutsPanelOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0.6;
    transform: scale(0.97) translateY(8px);
  }
}

/* Panel header */
.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.shortcuts-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shortcuts-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

.shortcuts-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.shortcuts-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.shortcuts-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Sections */
.shortcuts-body {
  padding: 20px 28px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.shortcuts-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shortcuts-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  padding: 0 0 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}

/* Individual shortcut row */
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  opacity: 0.6;
  transform: translateY(4px);
  animation: shortcutRowIn 300ms var(--ease-out) both;
}

@keyframes shortcutRowIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shortcut-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shortcut-keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-bottom-width: 2px;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  line-height: 1;
}

.shortcut-keys .shortcut-or {
  font-size: 10px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* Footer hint */
.shortcuts-footer {
  padding: 12px 28px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shortcuts-footer-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.shortcuts-footer-link {
  font-size: var(--text-xs);
  color: var(--accent-primary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.shortcuts-footer-link:hover {
  color: var(--accent-hover);
}

/* Virtual scroll sentinel */
.virtual-scroll-sentinel {
  width: 100%;
  height: 1px;
  pointer-events: none;
}

/* Lazy image placeholder */
.clip-media-lazy {
  background: var(--bg-elevated);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: background var(--duration-normal) var(--ease-out);
}

.clip-media-lazy.loaded {
  background: transparent;
  min-height: 0;
}

/* Responsive: single column on narrow */
@media (max-width: 520px) {
  .shortcuts-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .shortcuts-panel {
    border-radius: var(--radius-lg);
  }
}

/* ── Phase 4G: Reduced Motion ────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .shortcuts-backdrop,
  .shortcuts-panel,
  .shortcut-row {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ── Phase 6: Export/Import Modal ─────────────────────────── */

.export-backdrop {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-8);
  overflow-y: auto;
  opacity: 0.6;
  animation: export-backdrop-in 180ms var(--ease-out) forwards;
}

.export-backdrop.closing {
  animation: export-backdrop-out 200ms var(--ease-out) forwards;
}

@keyframes export-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes export-backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.export-modal {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated),
              0 0 0 1px rgba(255, 255, 255, 0.04),
              0 32px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  opacity: 0.6;
  transform: translateY(8px);
  animation: export-modal-in 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.export-backdrop.closing .export-modal {
  animation: export-modal-out 200ms var(--ease-out) forwards;
}

@keyframes export-modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes export-modal-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(6px); }
}

/* ── Modal Header ─────────────────────────────────────────── */

.export-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.export-modal-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.export-modal-close {
  padding: var(--space-1);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ── Section ──────────────────────────────────────────────── */

.export-section {
  padding: var(--space-5) var(--space-6);
}

.export-section + .export-section {
  border-top: 1px solid var(--border-subtle);
}

.export-section-head {
  margin-bottom: var(--space-4);
}

.export-section-title {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.export-section-title svg {
  color: var(--accent-primary);
}

.export-section-sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ── Selected-only toggle ─────────────────────────────────── */

.export-selected-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--accent-subtle);
  border: 1px solid rgba(200, 230, 74, 0.15);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--accent-primary);
}

.export-selected-toggle input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.export-selected-toggle label {
  cursor: pointer;
  user-select: none;
}

.export-selected-toggle .export-selected-count {
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ── Format Cards Grid ────────────────────────────────────── */

.export-formats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.export-format-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  text-align: left;
  font-family: var(--font-body);
  overflow: hidden;
}

.export-format-card:hover {
  background: rgba(30, 30, 36, 0.96);
  border-color: rgba(200, 230, 74, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.24);
}

.export-format-card:active {
  transform: translateY(0);
  transition-duration: 80ms;
}

.export-format-card.exporting {
  pointer-events: none;
  border-color: rgba(200, 230, 74, 0.3);
}

.export-format-card.exporting .export-card-icon {
  animation: export-spin 800ms linear infinite;
}

@keyframes export-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.export-card-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--accent-primary);
  flex-shrink: 0;
  transition: background var(--duration-fast) var(--ease-out);
}

.export-format-card:hover .export-card-icon {
  background: rgba(200, 230, 74, 0.18);
}

.export-card-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.export-card-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

.export-card-note {
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.4;
  margin-top: auto;
}

/* ── Drag-Drop Import Zone ────────────────────────────────── */

.import-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-6);
  border: 2px dashed rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  text-align: center;
}

.import-dropzone:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(30, 30, 36, 0.8);
}

.import-dropzone.dragover {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 4px rgba(200, 230, 74, 0.08),
              inset 0 0 30px rgba(200, 230, 74, 0.03);
}

.import-dropzone-icon {
  color: var(--text-tertiary);
  transition: color var(--duration-fast) var(--ease-out);
}

.import-dropzone:hover .import-dropzone-icon,
.import-dropzone.dragover .import-dropzone-icon {
  color: var(--accent-primary);
}

.import-dropzone-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.import-dropzone-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.import-dropzone-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.import-dropzone-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.import-dropzone-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

/* ── Boards View ──────────────────────────────────────────── */
.lib-boards {
  padding: 24px;
}

.lib-boards--preview .pro-preview-banner {
  margin-bottom: var(--space-5);
}

.boards-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
  color: var(--text-secondary);
}

.boards-empty-icon {
  color: var(--accent-primary);
}

.boards-empty-title {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-2xl);
}

.boards-empty-sub {
  max-width: 480px;
  margin: 0 0 6px;
  line-height: 1.55;
}

.board-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.board-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.board-header--preview {
  align-items: center;
}

.board-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.board-add-section-select {
  min-width: 150px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 7px 9px;
}

.board-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.board-title-input,
.board-description-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
}

.board-title-input {
  font-size: var(--text-3xl);
  line-height: 1.1;
}

.board-description-input {
  resize: vertical;
  min-height: 42px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.board-title-input:focus,
.board-description-input:focus {
  outline: none;
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}

.board-preview-title {
  color: var(--text-primary);
  font-size: var(--text-3xl);
  line-height: 1.1;
}

.board-preview-description {
  color: var(--text-secondary);
  line-height: 1.5;
}

.board-sections {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
}

.board-section {
  min-height: 260px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  padding: 12px;
}

.board-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.board-section-title {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0;
}

.board-section-title:focus {
  outline: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
}

.board-section-action {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.board-section-action:hover {
  color: var(--text-primary);
  border-color: var(--border-subtle);
  background: var(--bg-primary);
}

.board-section-action--add:hover {
  color: var(--accent-primary);
  border-color: rgba(200, 230, 74, 0.28);
  background: rgba(200, 230, 74, 0.1);
}

.board-section-action--remove:hover {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.1);
}

.board-section.is-drag-over {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.board-section--preview {
  cursor: default;
}

.board-section-title--preview {
  cursor: default;
}

.board-section-preview-lock {
  display: inline-flex;
  color: var(--text-tertiary);
}

.board-section-empty {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.board-clip-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 10px;
  position: relative;
}

.board-clip-divider {
  height: 1px;
  margin: 14px 2px;
  background: rgba(255, 255, 255, 0.16);
}

.board-clip-card.is-dragging {
  opacity: 0.5;
}

.board-clip-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(13, 13, 15, 0.72);
  color: var(--text-tertiary);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
  z-index: 1;
}

.board-clip-card:hover .board-clip-remove,
.board-clip-remove:focus-visible {
  opacity: 1;
}

.board-clip-remove:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.board-clip-card--preview {
  cursor: default;
}

.board-clip-media {
  aspect-ratio: 16 / 10;
  background: var(--bg-secondary);
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
}

.board-clip-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.board-clip-body {
  padding: 10px;
}

.board-clip-title {
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.board-clip-source {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  margin-bottom: 8px;
}

.board-clip-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.board-clip-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .board-header {
    flex-direction: column;
  }

  .board-sections {
    grid-template-columns: repeat(5, minmax(220px, 1fr));
  }
}

/* ── Import Progress ──────────────────────────────────────── */

.import-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
}

.import-progress-bar-track {
  width: 100%;
  height: 4px;
  background: var(--bg-deep);
  border-radius: 2px;
  overflow: hidden;
}

.import-progress-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: width 200ms var(--ease-out);
  box-shadow: 0 0 8px var(--accent-glow);
}

.import-progress-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.import-result {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.import-result.success {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  color: var(--success);
}

.import-result.error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: var(--danger);
}

.import-result svg {
  flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 640px) {
  .export-formats {
    grid-template-columns: repeat(2, 1fr);
  }

  .export-modal {
    margin: var(--space-4);
    max-width: calc(100vw - 32px);
  }

  .export-backdrop {
    padding: var(--space-4);
  }
}

@media (max-width: 420px) {
  .export-formats {
    grid-template-columns: 1fr;
  }

  .export-section {
    padding: var(--space-4);
  }

  .export-modal-header {
    padding: var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .export-backdrop,
  .export-modal,
  .export-format-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .export-format-card:hover {
    transform: none;
  }

  .import-dropzone.dragover {
    animation: none;
  }
}

/* Final mock-style refinements */
.lib-sidebar-expand-btn {
  display: inline-flex !important;
}

.lib-sidebar-toggle {
  display: none;
}

.lib-sidebar-section-label {
  padding: 14px 10px 7px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(242, 240, 237, 0.5);
  letter-spacing: 0.1em;
}

.lib-sidebar-section-action {
  color: rgba(242, 240, 237, 0.42);
}

.lib-sidebar-nav-item {
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
}

.lib-sidebar-nav-label {
  color: rgba(242, 240, 237, 0.88);
}

.lib-sidebar-nav-item:not(.active) .lib-sidebar-nav-label,
.lib-sidebar-folder-item:not(.active) .lib-sidebar-folder-label {
  color: rgba(242, 240, 237, 0.76);
}

.lib-sidebar-nav-item.active .lib-sidebar-nav-label,
.lib-sidebar-folder-item.active .lib-sidebar-folder-label {
  color: var(--accent-primary);
}

.lib-sidebar-nav-count,
.lib-sidebar-folder-count {
  min-width: 20px;
  font-size: 11px;
}

.lib-sidebar-folder-item {
  padding: 7px 10px;
  font-size: 13.5px;
}

.lib-sidebar-folder-label {
  color: rgba(242, 240, 237, 0.76);
}

/* Folder indentation alignment */
#sidebar-folders {
  --sidebar-folder-root-indent: 18px;
  --sidebar-folder-child-indent: 46px;
  --sidebar-folder-branch-indent: 31px;
}

.lib-sidebar-folder-item,
.lib-sidebar-new-folder {
  padding: 7px 10px;
  padding-left: var(--sidebar-folder-root-indent);
  gap: 8px;
}

.lib-sidebar-folder-chevron {
  position: absolute;
  left: 4px;
  width: 14px;
  height: 18px;
  margin: 0;
}

.lib-sidebar-folder-chevron.empty {
  display: none;
}

.lib-sidebar-folder-item.lib-sidebar-subfolder-item,
.lib-sidebar-new-folder.lib-subfolder-input-wrap {
  padding-left: var(--sidebar-folder-child-indent);
}

.lib-sidebar-folder-branch {
  left: var(--sidebar-folder-branch-indent);
}

.lib-sidebar-tag-cloud {
  gap: 8px;
}

.lib-sidebar-tag {
  font-size: 12px;
}

@media (max-height: 780px) {
  #sidebar-folder-list,
  .lib-sidebar-tag-cloud {
    max-height: none;
    overflow: visible;
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
}

.clip-title {
  margin-bottom: 7px;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.clip-title:hover,
.clip-title:focus {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.clip-note-edit {
  width: 100%;
  min-height: 0;
  margin: 0 0 8px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-style: italic;
}

.clip-note-edit:hover,
.clip-note-edit:focus {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.lib-list {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(22, 22, 26, 0.55);
}

.list-header {
  padding: 10px 14px;
  background: rgba(13, 13, 15, 0.9);
}

.list-row {
  padding: 10px 14px;
}

.compare-col {
  border-radius: 12px;
}

/* ── Onboarding Tooltips ───────────────────────────────────── */

.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 9000;
  pointer-events: all;
}

.onboarding-tooltip {
  position: fixed;
  z-index: 9001;
  width: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 0 2px var(--accent-subtle);
  animation: tooltipPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
}

@keyframes tooltipPop {
  0% { opacity: 0; transform: scale(0.95) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.onboarding-tooltip-content h4 {
  font-size: 16px;
  margin: 0 0 8px 0;
  color: var(--accent-primary);
}

.onboarding-tooltip-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.onboarding-tooltip-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.onboarding-step-indicator {
  font-size: 12px;
  color: var(--text-tertiary);
}

.onboarding-btn {
  background: var(--accent-primary);
  color: #0d0d0f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.onboarding-btn:hover {
  background: var(--accent-hover);
}

/* Arrow */
.onboarding-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-focus);
  border-left: 1px solid var(--border-focus);
  transform: rotate(45deg);
}

/* Arrow positioning classes */
.onboarding-tooltip[data-placement="right"] .onboarding-arrow {
  left: -6.5px;
  top: 20px;
  border-top: none;
  border-left: 1px solid var(--border-focus);
  border-bottom: 1px solid var(--border-focus);
}

.onboarding-tooltip[data-placement="bottom"] .onboarding-arrow {
  top: -6.5px;
  left: 50%;
  margin-left: -6px;
}

.onboarding-tooltip[data-placement="top"] .onboarding-arrow {
  bottom: -6.5px;
  left: 50%;
  margin-left: -6px;
  border-top: none;
  border-left: none;
  border-right: 1px solid var(--border-focus);
  border-bottom: 1px solid var(--border-focus);
}

/* Highlight effect for target elements */
.onboarding-highlight {
  position: relative !important;
  z-index: 9002 !important;
  box-shadow: 0 0 0 4px var(--bg-deep), 0 0 0 6px var(--accent-primary) !important;
  border-radius: inherit;
  transition: box-shadow 0.3s ease;
  background: var(--bg-surface) !important;
}
