.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.type-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------- List grid ---------- */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.list-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
  animation: card-in 0.2s var(--ease);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.list-card:hover {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent);
  transform: translateY(-2px);
}

.list-card.pinned {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), var(--shadow-sm);
}

.list-card.pinned:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-md);
  transform: translateY(-2px);
}

.type-icon.shopping {
  background: color-mix(in srgb, #10b981 16%, transparent);
  color: #10b981;
}
.type-icon.todo {
  background: color-mix(in srgb, #3b82f6 16%, transparent);
  color: #3b82f6;
}
:root[data-theme='dark'] .type-icon.todo {
  color: #60a5fa;
}
.type-icon.checklist {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.list-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.list-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.list-title {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.list-card-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.list-card-actions .icon-btn-round {
  width: 32px;
  height: 32px;
}

.list-card-actions .icon-btn-round .icon {
  width: 16px;
  height: 16px;
}

.list-card-actions .icon-btn-round.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.list-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 12px;
  margin-left: 39px;
}

.list-progress-track {
  flex: 1;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  overflow: hidden;
}

.list-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.2s var(--ease);
}

.list-progress-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ---------- Checklist items ---------- */
.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
}

.checklist-item:hover {
  background: var(--bg-subtle);
}

.checklist-item input[type='checkbox'] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.checklist-item-text {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text);
  overflow-wrap: anywhere;
  cursor: text;
}

.checklist-item.checked .checklist-item-text {
  color: var(--text-faint);
  text-decoration: line-through;
}

.checklist-item-text-edit {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 0 6px;
  font-size: 13.5px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.checklist-item-delete {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 3px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  opacity: 0;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}

.checklist-item:hover .checklist-item-delete {
  opacity: 1;
}

.checklist-item-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.checklist-item-delete .icon {
  width: 13px;
  height: 13px;
}

.checklist-empty {
  font-size: 13px;
  color: var(--text-faint);
  padding: 10px 4px;
  text-align: center;
}

.add-item-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.add-item-input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.add-item-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: var(--primary-text-on);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s var(--ease);
}

.add-item-btn:hover {
  filter: brightness(1.08);
}

.add-item-btn .icon {
  width: 16px;
  height: 16px;
}

.list-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  margin-left: 39px;
}

.category-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.clear-checked-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
}

.clear-checked-btn:hover {
  color: var(--primary-text);
  text-decoration: underline;
}
