/* ============================================================================
   CUSTOM LISTS & NOTES WORKSPACE ("List" Tab)
   ============================================================================ */
.custom-lists-stage {
  display: none;
  flex: 1;
  padding: 20px 28px 96px;
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
}

.custom-lists-stage.active {
  display: block;
}

.lists-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 16px;
}

.lists-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-width: 220px;
  margin-right: 14px;
}

.lists-hero-copy > * + * {
  margin-top: 4px;
}

.lists-hero-copy h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.lists-hero-copy p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 62ch;
}

.lists-hero-actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.lists-hero-actions > * + * {
  margin-left: 10px;
}

.lists-summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lists-hero-new-btn {
  display: none;
}

.lists-workspace-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Left Panel: Category Search & Directory */
.lists-directory-panel {
  background: var(--bg-surface-alt);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 14px;
  box-shadow: inset 0 2px 5px rgba(42, 37, 33, 0.04), var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: calc(var(--header-height) + 14px);
}

.lists-directory-panel > * + * {
  margin-top: 10px;
}

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

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

.lists-search-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 36px 10px 36px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lists-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.lists-search-clear {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lists-search-clear:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.lists-quick-cat-form {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.lists-quick-cat-form > * + * {
  margin-left: 8px;
}

.pro-form-input.lists-quick-cat-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  font-size: 0.86rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
}

.btn-lists-quick-cat {
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-lists-quick-cat:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.lists-categories-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 2px;
}

.lists-categories-nav > * + * {
  margin-top: 6px;
}

.list-cat-nav-item {
  position: relative;
  border-radius: var(--radius-md);
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.list-cat-nav-item.is-dragging,
.list-overview-card.is-dragging {
  opacity: 0.45;
}

.list-cat-nav-item.is-drop-before::before {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  top: -4px;
  height: 3px;
  border-radius: 99px;
  background: var(--primary);
  z-index: 3;
}

.list-cat-nav-item.is-drop-after::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -4px;
  height: 3px;
  border-radius: 99px;
  background: var(--primary);
  z-index: 3;
}

.list-overview-card.is-drop-before {
  box-shadow: -4px 0 0 0 var(--primary), var(--shadow-md);
  border-color: var(--primary);
}

.list-overview-card.is-drop-after {
  box-shadow: 4px 0 0 0 var(--primary), var(--shadow-md);
  border-color: var(--primary);
}

.list-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  margin-right: 4px;
  margin-left: -4px;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
}

.list-drag-handle:active {
  cursor: grabbing;
}

.list-cat-nav-btn.active .list-drag-handle {
  color: rgba(255, 255, 255, 0.8);
}

.list-cat-nav-btn {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.list-cat-nav-btn:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.list-cat-nav-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.list-cat-nav-main {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.list-cat-nav-main > * + * {
  margin-left: 9px;
}

.list-cat-nav-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-cat-color-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
}

.list-cat-nav-btn.active .list-cat-color-dot {
  border-color: rgba(255, 255, 255, 0.85);
}

.list-cat-color-dot.color-sage { background: #3D7A5A; }
.list-cat-color-dot.color-amber { background: #D97706; }
.list-cat-color-dot.color-mint { background: #0F766E; }
.list-cat-color-dot.color-rose { background: #BE123C; }
.list-cat-color-dot.color-neutral { background: #78716C; }

.list-cat-count-badge {
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  flex-shrink: 0;
}

.list-cat-nav-btn.active .list-cat-count-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.list-cat-create-from-search {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.list-cat-create-from-search:hover {
  background: var(--primary);
  color: #FFFFFF;
}

/* Right Panel: Selected Category Detail & Entries */
.lists-detail-panel {
  background: var(--bg-surface-alt);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: inset 0 2px 5px rgba(42, 37, 33, 0.05), var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.lists-detail-panel > * + * {
  margin-top: 14px;
}

.lists-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.lists-detail-header.accent-sage { border-left: 5px solid #3D7A5A; }
.lists-detail-header.accent-amber { border-left: 5px solid #D97706; }
.lists-detail-header.accent-mint { border-left: 5px solid #0F766E; }
.lists-detail-header.accent-rose { border-left: 5px solid #BE123C; }
.lists-detail-header.accent-neutral { border-left: 5px solid #78716C; }

.lists-detail-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 160px;
  margin-right: 12px;
}

.lists-detail-title {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  overflow-wrap: break-word;
  min-width: 0;
}

.lists-detail-title-group > * + * {
  margin-left: 10px;
}

.lists-detail-count {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lists-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: -6px;
}

.lists-detail-actions > * {
  margin-top: 6px;
}

.lists-detail-actions > * + * {
  margin-left: 8px;
}

.btn-list-header-action {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface-alt);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-list-header-action > * + * {
  margin-left: 5px;
}

.btn-list-header-action:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-list-header-action.danger:hover {
  border-color: var(--danger-red);
  background: var(--danger-soft);
  color: var(--danger-red);
}

.lists-detail-more-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-list-more-toggle {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.list-cat-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  z-index: 40;
}

.list-cat-more-menu.open {
  display: flex;
  flex-direction: column;
}

.list-cat-more-menu > * + * {
  margin-top: 2px;
}

.list-more-menu-item {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.list-more-menu-item > * + * {
  margin-left: 9px;
}

.list-more-menu-item:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.list-more-menu-item.danger {
  color: var(--danger-red);
}

.list-more-menu-item.danger:hover {
  background: var(--danger-soft);
  color: var(--danger-red);
}

.list-more-menu-divider {
  height: 1px;
  margin: 4px 6px;
  background: var(--border-subtle);
}

/* Inline Entry Composer */
.lists-entry-composer {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.lists-entry-composer > * + * {
  margin-left: 10px;
}

.lists-composer-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1.15fr) minmax(0, 1.25fr);
  gap: 8px;
  flex: 1;
  min-width: 0;
  align-items: start;
}

.lists-composer-cat-select {
  min-height: 48px;
  max-width: 170px;
  font-weight: 700;
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-subtle);
}

.lists-composer-cat-select.is-hidden-select {
  display: none;
}

.lists-composer-grid.no-cat-select {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
}

.lists-composer-title-input {
  min-height: 48px;
  font-weight: 600;
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-subtle);
}

.lists-composer-note-input {
  min-height: 48px;
  max-height: 140px;
  resize: vertical;
  overflow-y: auto;
  padding-top: 12px;
  padding-bottom: 10px;
  line-height: 1.35;
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-subtle);
}

.lists-composer-title-input:focus,
.lists-composer-note-input:focus,
.lists-composer-cat-select:focus {
  background: var(--bg-surface);
  border-color: var(--primary);
}

.lists-composer-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  white-space: nowrap;
  flex-shrink: 0;
}

.lists-composer-submit > * + * {
  margin-left: 6px;
}

.lists-detail-panel > .list-entry-parse-preview {
  margin-top: 8px;
}

/* Recessed Entries Well & Entry Cards (No Checkboxes) */
.lists-entries-mount {
  min-width: 0;
}

.list-entries-well {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(42, 37, 33, 0.035);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: inset 0 2px 6px rgba(42, 37, 33, 0.06);
}

.list-entries-well > * + * {
  margin-top: 10px;
}

[data-theme="dark"] .list-entries-well {
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}

.list-entry-card {
  position: relative;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 13px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.12s ease;
}

.list-entry-card.is-dragging {
  opacity: 0.45;
}

.list-entry-card.is-drop-before::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: -6px;
  height: 3px;
  border-radius: 99px;
  background: var(--primary);
  z-index: 3;
}

.list-entry-card.is-drop-after::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -6px;
  height: 3px;
  border-radius: 99px;
  background: var(--primary);
  z-index: 3;
}

.list-entry-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.list-entry-card > * + * {
  margin-left: 12px;
}

.list-entry-main {
  display: flex;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.list-entry-drag-handle {
  margin-top: 1px;
  margin-right: 6px;
}

.list-entry-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.list-entry-note-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.list-entry-note-link:hover {
  color: var(--primary-hover);
}

.list-search-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--text-main);
  font-size: 0.82rem;
}

.list-search-filter-clear {
  border: 1px solid var(--primary-border);
  background: var(--bg-surface);
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  margin-left: 8px;
}

.list-search-filter-clear:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.list-entry-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  overflow-wrap: break-word;
}

.list-entry-note {
  margin-top: 5px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.list-entry-note.is-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
}

.list-entry-card.is-pinned {
  border-color: var(--breakfast-border);
  background: var(--breakfast-bg);
}

[data-theme="dark"] .list-entry-card.is-pinned {
  background: rgba(217, 119, 6, 0.11);
  border-color: rgba(245, 158, 11, 0.42);
}

.list-entry-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.list-entry-title-row > * {
  margin-right: 7px;
}

.list-entry-title-row > *:last-child {
  margin-right: 0;
}

.list-entry-pin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--breakfast-tag);
  border: 1px solid var(--breakfast-border);
  color: var(--breakfast-text);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.list-entry-meta {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.btn-goal-icon-action.is-pinned-active {
  background: var(--breakfast-tag);
  border-color: var(--breakfast-border);
  color: var(--breakfast-text);
}

.list-archived-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: var(--breakfast-tag);
  border: 1px solid var(--breakfast-border);
  color: var(--breakfast-text);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.list-cat-archive-toggle {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.list-cat-archive-toggle:hover,
.list-cat-archive-toggle.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.list-overview-footer-btns {
  display: flex;
  align-items: center;
}

.list-overview-footer-btns > * + * {
  margin-left: 8px;
}

.list-overview-footer-btns .list-overview-open-btn {
  flex: 1;
}

.list-overview-restore-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface-alt);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.list-overview-restore-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.list-modal-meta {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: -2px;
  margin-bottom: 12px;
}

.list-modal-promote-section {
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
}

.list-modal-promote-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: -6px;
}

.list-modal-promote-actions > * {
  margin-top: 6px;
}

.list-modal-promote-actions > * + * {
  margin-left: 8px;
}

.btn-list-promote {
  flex: 1 1 160px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-list-promote > * + * {
  margin-left: 6px;
}

.btn-list-promote:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.list-entry-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.list-entry-actions > * + * {
  margin-left: 6px;
}

/* All Categories Overview Grid */
.lists-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.list-overview-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.list-overview-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.list-overview-card > * + * {
  margin-top: 10px;
}

.list-overview-card.accent-sage { border-top: 4px solid #3D7A5A; }
.list-overview-card.accent-amber { border-top: 4px solid #D97706; }
.list-overview-card.accent-mint { border-top: 4px solid #0F766E; }
.list-overview-card.accent-rose { border-top: 4px solid #BE123C; }
.list-overview-card.accent-neutral { border-top: 4px solid #78716C; }

.list-overview-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  cursor: pointer;
}

.list-overview-head-left {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.list-overview-head-left > * + * {
  margin-left: 4px;
}

.list-overview-head-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 8px;
}

.list-overview-head-right > * + * {
  margin-left: 6px;
}

.list-overview-dup-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.list-overview-dup-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.list-overview-card-head h3 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  overflow-wrap: break-word;
  min-width: 0;
}

.list-overview-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.list-overview-preview > * + * {
  margin-top: 7px;
}

.list-overview-item-row {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
}

.list-overview-item-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.list-overview-item-note {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-overview-more {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-left: 4px;
}

.list-overview-open-btn {
  width: 100%;
  min-height: 42px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.list-overview-open-btn:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.lists-empty-state {
  text-align: center;
  padding: 36px 20px;
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lists-empty-state > * + * {
  margin-top: 8px;
}

/* Color Picker Swatches inside Category Modal */
.lists-color-picker {
  display: flex;
  align-items: center;
}

.lists-color-picker > * + * {
  margin-left: 10px;
}

.lists-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.lists-color-swatch[data-list-color="sage"] { background: #3D7A5A; }
.lists-color-swatch[data-list-color="amber"] { background: #D97706; }
.lists-color-swatch[data-list-color="mint"] { background: #0F766E; }
.lists-color-swatch[data-list-color="rose"] { background: #BE123C; }
.lists-color-swatch[data-list-color="neutral"] { background: #78716C; }

.lists-color-swatch.active {
  border-color: var(--text-main);
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

@media (max-width: 960px) {
  .lists-workspace-grid {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 14px;
  }

  .lists-entry-composer {
    flex-direction: column;
  }

  .lists-entry-composer > * + * {
    margin-left: 0;
    margin-top: 8px;
  }

  .lists-composer-grid,
  .lists-composer-grid.no-cat-select {
    grid-template-columns: 1fr;
  }

  .lists-composer-cat-select {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .custom-lists-stage {
    padding: 14px 12px calc(var(--mobile-nav-height) + 84px);
    max-width: 100%;
    overflow-x: hidden;
  }

  .lists-hero-bar {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 12px;
  }

  .lists-hero-copy {
    min-width: 0;
    margin-right: 0;
    margin-bottom: 10px;
  }

  .lists-hero-copy h2 {
    font-size: 1.25rem;
  }

  .lists-hero-copy p {
    font-size: 0.8rem;
  }

  .lists-hero-actions {
    width: 100%;
    justify-content: space-between;
  }

  .lists-hero-new-btn {
    display: inline-flex;
    min-height: 40px;
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .lists-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .lists-directory-panel {
    position: static;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    padding: 12px;
    border-radius: var(--radius-lg);
  }

  .lists-categories-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .lists-categories-nav > * + * {
    margin-top: 0;
    margin-left: 8px;
  }

  .list-cat-nav-item {
    flex-shrink: 0;
  }

  .list-cat-nav-item.is-drop-before::before {
    left: -5px;
    right: auto;
    top: 4px;
    bottom: 4px;
    width: 3px;
    height: auto;
  }

  .list-cat-nav-item.is-drop-after::after {
    left: auto;
    right: -5px;
    top: 4px;
    bottom: 4px;
    width: 3px;
    height: auto;
  }

  .list-cat-nav-btn {
    width: auto;
    min-width: max-content;
    flex-shrink: 0;
    padding: 8px 12px;
  }

  .list-cat-create-from-search,
  .list-cat-archive-toggle {
    width: auto;
    min-width: max-content;
    flex-shrink: 0;
  }

  .lists-detail-panel {
    min-width: 0;
    width: 100%;
    overflow: visible;
    padding: 12px;
    border-radius: var(--radius-lg);
  }

  .lists-detail-header {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
  }

  .lists-detail-title-group {
    flex: none;
    margin-right: 0;
    width: 100%;
  }

  .lists-detail-actions {
    margin-top: 8px;
    width: 100%;
    justify-content: flex-start;
  }

  .lists-detail-actions > * + * {
    margin-left: 6px;
  }

  .lists-detail-more-wrap {
    margin-left: auto !important;
  }

  .btn-list-header-action {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 0.76rem;
  }

  .btn-list-more-toggle {
    width: 38px;
    min-width: 38px;
    padding: 0;
  }

  .lists-overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .list-entries-well {
    padding: 8px;
  }

  .list-entry-card {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .list-entry-card > * + * {
    margin-left: 0;
    margin-top: 10px;
  }

  .list-entry-actions {
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle);
  }

}

/* Inline Quick-Add Form on List Cards */
.list-card-quick-add-form {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.list-card-quick-add-form.is-detail-inline {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.list-card-quick-input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 6px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-app);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.84rem;
  margin-right: 6px;
}

.list-card-quick-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn-list-card-quick-add {
  min-height: 38px;
  padding: 6px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.btn-list-card-quick-add:hover {
  background: var(--primary-hover);
}
